-
Notifications
You must be signed in to change notification settings - Fork 97
Start turning GitGitGadget into a set of GitHub Actions and workflows #1392
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
Draft
dscho
wants to merge
40
commits into
main
Choose a base branch
from
github-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+655
−396
Draft
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
e6e3cd3
git-notes.test: avoid network calls
dscho 30be28d
ci-helper.test: avoid network call
dscho 33ab15f
Move the `getExternalConfig()` function to a better home
dscho b74f759
Merge branch 'no-network-calls'
dscho 0cda7a4
CIHelper: make the `config` an explicit constructor parameter
dscho 44e8d51
CIHelper: make even the `workDir` an optional parameter
dscho 39729f4
GitGitGadget: be intentional about the push URL in addition to the token
dscho 21a4026
CIHelper: allow specifying the information to send emails
dscho 4a8d5c7
Merge branch 'prepare-config-handling'
dscho 55ea650
Only demand that SMTP is configured when it is actually needed
dscho 2188aba
Restart the effort to turn GitGitGadget's core logic into a GitHub Ac…
dscho cfb828b
Merge branch 'prepare-config-handling'
dscho c48de1f
CIHelper: add a convenient function to initialize e.g. the Git worktree
dscho b8ecec6
CIHelper.setupGitHubAction(): also process the SMTP inputs, if any
dscho c4d3c30
CIHelper.setupGitHubAction: configure Git committer information
dscho 6ea8107
TODO: IHelper.setupGitHubAction: address the needs of GitGitGadget's …
dscho 0ce0ae0
CIHelper: offer a convenient method to parse a PR comment URL
dscho 95110b8
Install @actions/core
dscho 7282d57
CIHelper: add a helper function to support the upcoming GitHub Action
dscho b12a397
Install `@vercel/ncc`
dscho f0f4e57
Run `ncc` via `npm run build-dist`
dscho 526a56a
TO-DROP: vscode: add a debug configuration for the `init` Action
dscho 015b3be
Ensure that `res/WELCOME.md` is found even after compiling with `ncc`
dscho fb1ad6f
DEBUG the `handle-pr-comment` Action locally
dscho f390ccf
eslint: in the upcoming JavaScript code, skip unneeded semicolons
dscho 8c72a39
Add the `gitgitgadget/init` GitHub Action
dscho f1f4bb6
eslint.config: adjust to new ESLint preferences
dscho 313a038
TEST: add a reaction
dscho 014a2be
Add the `handle-pr-comment` GitHub Action
dscho 3e188c0
DEBUG: optionally avoid all actions
dscho 2568621
Merge branch 'add-the-action'
dscho 9c3d346
TO-DROP: add dist/index.js, for testing
dscho ad71d72
TO-DROP: test the GitHub Action
dscho effd657
TO-DROP: disable all CI builds except `test-action`
dscho fd767e0
DEBUGGING: add a `git()` proxy method to `CIHelper`
dscho 6b9fd1d
TEST: proxy `isAllowed()` from CIHelper to GitGitGadget
dscho d79db71
TEST: verify that GitGitGadget's options were fetched
dscho 36de3c4
DEBUG: more logging
dscho 57f11f4
npm ci && npm run build && npm run build-dist
dscho 1e5c77f
Merge branch 'test-action'
dscho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Test the GitHub Action | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
test-action: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: gitgitgadget-git-token | ||
with: | ||
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }} | ||
owner: gitgitgadget | ||
repositories: git | ||
- uses: actions/create-github-app-token@v1 | ||
id: git-git-token | ||
with: | ||
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} | ||
owner: git | ||
repositories: git | ||
- uses: actions/create-github-app-token@v1 | ||
id: dscho-git-token | ||
with: | ||
app-id: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.GITGITGADGET_GIT_GITHUB_APP_PRIVATE_KEY }} | ||
owner: dscho | ||
repositories: git | ||
- uses: actions/checkout@v5 | ||
- uses: ./handle-pr-comment | ||
with: | ||
gitgitgadget-git-access-token: ${{ steps.gitgitgadget-git-token.outputs.token }} | ||
git-git-access-token: ${{ steps.git-git-token.outputs.token }} | ||
dscho-git-access-token: ${{ steps.dscho-git-token.outputs.token }} | ||
smtp-options: '{"user": "[email protected]", "host": "smtp.gmail.com", "pass": ${{ toJSON(secrets.GITGITGADGET_SMTP_PASS) }}}' | ||
pr-comment-url: https://github.com/gitgitgadget/git/pull/1947#issuecomment-3193794374 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = eval("require")("."); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Welcome to [GitGitGadget](https://gitgitgadget.github.io/) | ||
|
||
Hi @${username}, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. | ||
|
||
Please make sure that either: | ||
|
||
- Your Pull Request has a good description, if it consists of multiple commits, as it will be used as cover letter. | ||
- Your Pull Request description is empty, if it consists of a single commit, as the commit message should be descriptive enough by itself. | ||
|
||
You can CC potential reviewers by adding a footer to the PR description with the following syntax: | ||
|
||
CC: Revi Ewer <[email protected]>, Ill Takalook <[email protected]> | ||
|
||
NOTE: DO NOT copy/paste your CC list from a previous GGG PR's description, | ||
because it will result in a malformed CC list on the mailing list. See | ||
[example](https://lore.kernel.org/git/[email protected]/). | ||
|
||
Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form: | ||
|
||
* the lines should not exceed 76 columns, | ||
* the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and | ||
* the commit messages' body should be [describing the "why?" of the change](https://git-scm.com/docs/SubmittingPatches#describe-changes). | ||
* Finally, the commit messages should end in a [Signed-off-by:](https://git-scm.com/docs/SubmittingPatches#dco) line matching the commits' author. | ||
|
||
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. | ||
dscho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Contributing the patches | ||
|
||
Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form `/allow`. A good way to find other contributors is to locate recent pull requests where someone has been `/allow`ed: | ||
|
||
* [Search: is:pr is:open "/allow"](https://github.com/gitgitgadget/git/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+%22%2Fallow%22) | ||
|
||
Both the person who commented `/allow` and the PR author are able to `/allow` you. | ||
|
||
An alternative is the channel [`#git-devel`](https://web.libera.chat/#git-devel) on the Libera Chat IRC network: | ||
|
||
<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345 | ||
<veteran> newcontributor: it is done | ||
<newcontributor> thanks! | ||
|
||
Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment `/submit`. | ||
|
||
If you want to see what email(s) would be sent for a `/submit` request, add a PR comment `/preview` to have the email(s) sent to you. You must have a public GitHub email address for this. Note that any reviewers CC'd via the list in the PR description will *not* actually be sent emails. | ||
|
||
After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to [reply via mail](https://gitgitgadget.github.io/reply-to-this)). | ||
|
||
If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the [Git mailing list archive](https://lore.kernel.org/git) (click the `(raw)` link), then import it into your mail program. If you use GMail, you can do this via: | ||
|
||
```sh | ||
curl -g --user "<EMailAddress>:<Password>" \ | ||
--url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt | ||
dscho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description): | ||
|
||
``` | ||
Changes since v1: | ||
- Fixed a typo in the commit message (found by ...) | ||
- Added a code comment to ... as suggested by ... | ||
... | ||
``` | ||
|
||
To send a new iteration, just add another PR comment with the contents: `/submit`. | ||
|
||
## Need help? | ||
|
||
New contributors who want advice are encouraged to join [[email protected]](https://groups.google.com/forum/#!forum/git-mentoring), where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join. | ||
|
||
You may also be able to find help in real time in the developer IRC channel, [`#git-devel`](https://web.libera.chat/#git-devel) on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of `#git-devel` is [archived](https://colabti.org/irclogger//irclogger_logs/git-devel), though. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 'Handle PR Comment' | ||
description: 'Handles slash commands such as /submit and /preview' | ||
author: 'Johannes Schindelin' | ||
inputs: | ||
gitgitgadget-git-access-token: | ||
description: 'The access token to work on gitgitgadget/git' | ||
required: true | ||
git-git-access-token: | ||
description: 'The access token to work on git/git' | ||
required: true | ||
dscho-git-access-token: | ||
description: 'The access token to work on dscho/git' | ||
required: true | ||
smtp-options: | ||
description: 'The SMTP options to use for sending emails' | ||
required: true | ||
pr-comment-url: | ||
description: 'The URL of the PR comment to add a reaction to' | ||
required: true | ||
runs: | ||
using: 'node20' | ||
main: './index.js' | ||
branding: | ||
icon: 'git-commit' | ||
color: 'orange' | ||
dscho marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.