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

[ci] Add /update command to update upstream_utils #6817

Closed
wants to merge 1 commit into from

Conversation

spacey-sooty
Copy link
Contributor

No description provided.

@spacey-sooty spacey-sooty requested a review from a team as a code owner July 9, 2024 15:01
@spacey-sooty spacey-sooty changed the title g[ci] Add /update command to update upstream_utils [ci] Add /update command to update upstream_utils Jul 9, 2024
@spacey-sooty
Copy link
Contributor Author

💀 CI doesn't like me today, can I get gradle CI rerun please?

Copy link
Member

@calcmogul calcmogul left a comment

Choose a reason for hiding this comment

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

This command seems like a really inefficient workflow for contributors. With /format, the formatter is almost guaranteed to succeed. upstream_utils, on the other hand, often fails to apply patches and requires that they be manually rebased. It's not usually as simple as bumping the upstream tag and rerunning the script.

Something that would be kinda neat is an upstream_utils script subcommand that takes a new tag. It would try to apply the patches to the new tag, and if it failed, automatically fetch the old tag, apply the patches, then start an interactive rebase (git rebase -i) onto the new tag (git rebase sometimes includes commits it shouldn't because repos like LLVM use a separate branch for each release).

We could also make that subcommand automatically run git format-patch new_tag..HEAD --abbrev=40 --zero-commit --no-signature on success and move the generated .patch files into allwpilib.

@@ -102,3 +102,87 @@ jobs:
# Commit
git commit -am "Regenerate pregenerated files"
git push

update:
Copy link
Member

Choose a reason for hiding this comment

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

This duplicates .github/workflows/upstream-utils.yml. Maybe you could dispatch to that workflow from here?

@Starlight220
Copy link
Member

then start an interactive rebase (git rebase -i) onto the new tag

Do you intend for this to be interactive? Or mechanically editing the command list with something like sed?

@calcmogul
Copy link
Member

calcmogul commented Jul 9, 2024

User interaction with interactive rebase was intentional. I don't see a good way of automating it. You can have a script modify the command list, but I'm not sure if keeping the last N entries, where N is the number of patches, is sufficient.

@Starlight220
Copy link
Member

Starlight220 commented Jul 9, 2024

Oh wait a moment

Git rebase has flags for this; I think this might work:

git rebase OLD_BASE HEAD --onto NEW_BASE

That should take the commit range OLD_BASE..HEAD (I keep forgetting if it includes OLD_BASE or not; if not then make it OLD_BASE^) and apply it on NEW_BASE.

I hope this is helpful

@calcmogul
Copy link
Member

Yea, that's way easier.

@calcmogul
Copy link
Member

OBE by #6829.

@calcmogul calcmogul closed this Jul 17, 2024
@spacey-sooty spacey-sooty deleted the updatecommand branch July 17, 2024 05:21
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.

3 participants