Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: support gpg sigin commit. #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Feat: support gpg sigin commit. #53

wants to merge 1 commit into from

Conversation

sdttttt
Copy link
Owner

@sdttttt sdttttt commented Mar 17, 2021

Feature

@sdttttt sdttttt added the enhancement New feature or request label Mar 17, 2021
@sdttttt sdttttt self-assigned this Mar 17, 2021
@pull-request-quantifier-deprecated

Great job!
This PR has 110 quantified lines of changes. It hits the sweet spot of 50 to 200 lines for the best PR experience!


Quantification details

Label      : Medium
Size       : +85 -25
Percentile : 42%

Total files changed: 6

Change summary by file extension:
.rs : +85 -25

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #53 (649a01c) into develop (c4e190b) will decrease coverage by 2.58%.
The diff coverage is 11.29%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #53      +/-   ##
===========================================
- Coverage    40.82%   38.24%   -2.59%     
===========================================
  Files           11       11              
  Lines          556      604      +48     
===========================================
+ Hits           227      231       +4     
- Misses         329      373      +44     
Impacted Files Coverage Δ
src/main.rs 0.00% <0.00%> (ø)
src/message.rs 21.95% <0.00%> (ø)
src/plugins/push.rs 0.00% <0.00%> (ø)
src/repo.rs 0.00% <0.00%> (ø)
src/util.rs 79.77% <0.00%> (-8.98%) ⬇️
src/log.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4e190b...649a01c. Read the comment docs.

@sdttttt sdttttt changed the base branch from master to develop March 17, 2021 06:10
@sdttttt sdttttt changed the title feta: Support gpg sigin commit. Feat: support gpg sigin commit. Mar 17, 2021
@sdttttt
Copy link
Owner Author

sdttttt commented Mar 19, 2021

progress report

Recently, I realized that perfectly supporting gpg in git2-rs is not an easy task.
the main library currently implementing gpg signature separation in Rust is gpgme. and gpgme relies on some complex link libraries. Makes gpgme not so easy to run on non-unix platforms (I need grc to be cross-platform
), and this may currently disrupt grc workflows.
I'll try to find a more reasonable implementation of Rust for the gpg signature.

Ref


self.after_commit()?;
/// check gpg is available, if true then using gpg sign commit.
/// github.com/sdttttt/gcr/issues/52 Thinks @Enter-tainer @CoelacanthusHex

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinks -> thanks?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out the mistake. I'll fix it before we finish.

@sdttttt sdttttt added the help wanted Extra attention is needed label Mar 19, 2021
@mainrs
Copy link

mainrs commented Mar 21, 2021

We had the same feature request for git-cm: mainrs/git-cm#16.
I hesitated as well as I couldn't get Windows support to work. Linking gpgme on Windows is unreliable as not everybody has Gpg4Win installed. Secondly, it would force the binary to run in 32bit mode. Not a dramatic consequence, but one that you should be aware off.

If you figure out an alternative, let me know :)

@sdttttt
Copy link
Owner Author

sdttttt commented Mar 22, 2021 via email

@mainrs
Copy link

mainrs commented Mar 22, 2021

I'm in the same boat. I have not much internal knowledge of GPG to be confident enough to provide an implementation that I can be sure of works properly. That's why I didn't implement the feature for now. I've opened an issue for sequoia to see what the scope of an implementation would be (whether the chunk of code I'd have to manage would be on the large side). Thanks for answering me!

Base automatically changed from develop to master April 9, 2021 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

commits generated by grc are not properly signed
3 participants