Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Re architecture token handling#1974

Merged
dscho merged 6 commits intomaingitgitgadget/gitgitgadget:mainfrom
re-architecture-token-handlinggitgitgadget/gitgitgadget:re-architecture-token-handlingCopy head branch name to clipboard
Aug 15, 2025
Merged

Re architecture token handling#1974
dscho merged 6 commits intomaingitgitgadget/gitgitgadget:mainfrom
re-architecture-token-handlinggitgitgadget/gitgitgadget:re-architecture-token-handlingCopy head branch name to clipboard

Conversation

@dscho
Copy link
Member

@dscho dscho commented Aug 15, 2025

The primary motivation for this change is to move GitGitGadget towards a set of GitHub Actions that are used in GitHub workflows. The urgency comes from a secondary, originally unanticipated motivation: When I merged #1473, I broke the current Azure Pipelines (the fancy push-or-merge-and-push strategy does not work because the Azure Pipelines cannot push the Git notes to gitgitgadget/git due to missing authorization).

So here comes a set of changes to allow specifying the token(s) to use by CIHelper in a much more intentional way. Previously, the idea was that the token to use was specified via the Git config options gitgitgadget.githubToken (and gitgitgadget.git.githubToken for git/git, where GitGitGadget requires less permissions; It does not need to push, just do things like adding PR comments). This still works, for backwards-compatibility (at least until I managed to move everything over to GitHub Actions/workflows), but now there is a much more explicit way to configure the tokens to use for specific GitHub rogs in the CIHelper object. This new method is now also called from misc-helper, which should fix the Azure Pipelines.

dscho added 3 commits August 15, 2025 19:37
This is not yet used, but will come in really handy when moving
GitGitGadget to a GitHub Action. No more fiddling with secrets in the
Git config!

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Previously, the token was automagically looked up via the Git config.
However, it is better to be less automagic about it, and pass it through
from the `CIHelper` (who will learn about the token in the next
commits).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is much better to be intentional about repository access, especially
in the upcoming GitHub Action, instead of magically setting the tokens
via a couple of config variables.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho requested a review from webstech August 15, 2025 19:46
@dscho
Copy link
Member Author

dscho commented Aug 15, 2025

I'll push some updates shortly (to make this more comprehensive a business of configuring tokens explicitly).

dscho added 3 commits August 15, 2025 20:57
This continues the new paradigm where the token is _not_ specified via
the Git config, but explicitly via a method of the `CIHelper` class.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When merging #1473 (Add
support for distributed notes updates), I did not anticipate that the
current Azure Pipelines were not prepared for that: Contrary to what I
had remembered, they did _not_ simply configure `http.extraHeader` to be
able to push (which is somewhat surprising because I authored them, and
I typically did that a lot in the olden days).

Happily, I _just_ introduced support for configuring a token in
`CIHelper` that is specifically used for accessing `gitgitgadget/git`,
including the Git notes pushes.

Let's teach `misc-helper` about this new trick, and pick up the token
that was configured via `set-app-token` and tell `CIHelper` to use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This completes the journey where the token is specified explicitly.

If you (like I did, when developing this patch) wonder how it worked
before: The Azure Pipelines set the `publishRemote` to a URL that
contains the token (which is also the reason why we need stunts like the
`redactGitHubToken()` method).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the re-architecture-token-handling branch from 1a4407b to ae860c0 Compare August 15, 2025 21:14
@dscho
Copy link
Member Author

dscho commented Aug 15, 2025

I'll just go ahead and merge this, as I think it will fix all those Azure Pipeline failures.

@dscho dscho merged commit 108901d into main Aug 15, 2025
6 checks passed
@dscho dscho deleted the re-architecture-token-handling branch August 15, 2025 21:25
@dscho
Copy link
Member Author

dscho commented Aug 15, 2025

I think it will fix all those Azure Pipeline failures.

Seems to do the job: re-run #1, re-run #2.

dscho added a commit that referenced this pull request Aug 16, 2025
In #1974, I changed the
way the push token is handed down from CIHelper to GitGitGadget instead
of relying on the Git config (or environment) to specify it implicitly.
Let's do the same for the URL of the repository to which to push the Git
notes and patch series iterations' tags.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Aug 16, 2025
In #1974, I changed the
way the push token is handed down from CIHelper to GitGitGadget instead
of relying on the Git config (or environment) to specify it implicitly.
Let's do the same for the URL of the repository to which to push the Git
notes and patch series iterations' tags.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 16, 2025
In gitgitgadget#1974, I changed the
way the push token is handed down from CIHelper to GitGitGadget instead
of relying on the Git config (or environment) to specify it implicitly.
Let's do the same for the URL of the repository to which to push the Git
notes and patch series iterations' tags.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/gitgitgadget that referenced this pull request Aug 17, 2025
In gitgitgadget#1974, I changed the
way the push token is handed down from CIHelper to GitGitGadget instead
of relying on the Git config (or environment) to specify it implicitly.
Let's do the same for the URL of the repository to which to push the Git
notes and patch series iterations' tags.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@webstech
Copy link
Contributor

@dscho Sorry I did not get a chance to comment on this. I did review it and had no issues but was looking at the publishRemote aspect. If the publishRemote env var/git config item no longer needs the auth token, isn't it just a value that can be generated from repo.host, repo.owner and repo.name in the config?

@dscho
Copy link
Member Author

dscho commented Aug 19, 2025

If the publishRemote env var/git config item no longer needs the auth token, isn't it just a value that can be generated from repo.host, repo.owner and repo.name in the config?

That is true! However, I am unclear whether it should be possible to publish to a separate remote altogether (there is no real need to "pollute" gitgitgadget/git with these notes, is there? They could go into a completely separate repository). Maybe the best time to revisit this would be after the migration to GitHub Actions? Because at that stage, interested people could start adapting GitGitGadget to other projects for real.

dscho added a commit that referenced this pull request Aug 20, 2025
In #1974, I changed the
way the push token is handed down from CIHelper to GitGitGadget instead
of relying on the Git config (or environment) to specify it implicitly.
Let's do the same for the URL of the repository to which to push the Git
notes and patch series iterations' tags.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.