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

doc: prefer to sign commits under nodejs repository #57311

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RafaelGSS
Copy link
Member

Although not required, I think adding this as a "recommended" is a good thing.

cc: @aduh95

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Mar 4, 2025
@RafaelGSS
Copy link
Member Author

RafaelGSS commented Mar 4, 2025

IIRC commit-queue does sign commits by default. But, in terms of creating releases, sometimes we forget to enforce this policy in backports, leading to some inconsistencies (as Antoine seen when we paired 😄)

@legendecas
Copy link
Member

commit-queue does not sign if it is commit-queue-rebase, e.g. #57121

Co-authored-by: Tobias Nießen <tniessen@tnie.de>
@RafaelGSS RafaelGSS added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Mar 4, 2025
@tniessen
Copy link
Member

tniessen commented Mar 4, 2025

FWIW, there have been multiple discussions about this in the past, and the benefit was generally considered marginal (see, for example, #15457, which would have made signing mandatory). That being said, I am not strictly opposed to this idea (and for a while I did sign my commits in this repository).

@joyeecheung
Copy link
Member

I think this is only relevant for those who push directly to branches in the repository? For people who will probably never push directly to the repository (I guess most collaborators don't these days) it's not as relevant.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

If there isn't one already in this document, including a link to documentation on how to use commit.gpgsign would be helpful to newcomers.

@eror123r

This comment was marked as off-topic.

@aduh95
Copy link
Contributor

aduh95 commented Mar 4, 2025

Recommending signatures is certainly fine, but I don't think it would be relevant to most contributors. Signatures are only really useful for things that require trust (e.g. unreviewed backports, release promotion), and are nice-to-have everywhere else on nodejs/node, and IMO barely relevant for PRs (which is what most contributors will ever do).

@RafaelGSS RafaelGSS added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 5, 2025
@RafaelGSS
Copy link
Member Author

RafaelGSS commented Mar 5, 2025

Yes, this is non-relevant for most of the contributors but Node.js releasers or anyone that attempts to backport a commit manually. Still, it's an optional recommendation, I'm fine either way.

Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

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

I think is a great recommendation, specially for releasers as we do some changed in the git history and our signatures can be verified (see)

Also worth mention that signature verification requires an extra step on GitHub commiter's side if we want to achieve the visual verification (ref):

image

Comment on lines +37 to +38
* It is recommended to sign all commits under the Node.js repository.
Run: `git config commit.gpgsign true` inside the `node` folder.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should consider making this recommendation on the ONBOARDING.md of nodejs/Release, and maybe reword it to ensure we're not setting a bar too high for newcomers:

Suggested change
* It is recommended to sign all commits under the Node.js repository.
Run: `git config commit.gpgsign true` inside the `node` folder.
* Consider configuring git to sign all commits when working on the Node.js repository.
Run: `git config commit.gpgsign true` inside the `node` folder.

Copy link
Member

Choose a reason for hiding this comment

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

I fear that whatever the wording, people are going to run the command, and later they will be confused as their git commit fail because of the missing signing key.

Copy link
Member

@joyeecheung joyeecheung Mar 6, 2025

Choose a reason for hiding this comment

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

Can it start with "if you have a GPG key set up locally that matches the email you use to contribute to Node.js" so that people who do not know what it is will skip it?

Copy link
Member

@richardlau richardlau Mar 6, 2025

Choose a reason for hiding this comment

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

FWIW there are multiple methods of signing commits with git. GitHub supports (i.e. can displayed "Verified") GPG, SSH, or S/MIME signatures.

For the release team we've recommend GPG keys, but this documentation is aimed at a broader audience (collaborators).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.