Skip to content

Add workflow for automatic rebase.#16

Open
DaniilKl wants to merge 9 commits intomasterfrom
add-rebase-script
Open

Add workflow for automatic rebase.#16
DaniilKl wants to merge 9 commits intomasterfrom
add-rebase-script

Conversation

@DaniilKl
Copy link
Copy Markdown

@DaniilKl DaniilKl commented Apr 9, 2026

No description provided.

@DaniilKl DaniilKl self-assigned this Apr 9, 2026
@DaniilKl
Copy link
Copy Markdown
Author

DaniilKl commented Apr 9, 2026

I am not sure why the actions launched the rebase.sh. This workflow is set up to be launched only when called by another workflow 😕 .

@DaniilKl DaniilKl force-pushed the add-rebase-script branch 2 times, most recently from 427cb2b to 5eae06d Compare April 9, 2026 09:30
@DaniilKl
Copy link
Copy Markdown
Author

DaniilKl commented Apr 9, 2026

I am not sure why the actions launched the rebase.sh. This workflow is set up to be launched only when called by another workflow 😕 .

It seems it was just an automatic check of the correctness of the rebase.yml, not the actual execution of the rebase.yml.

@DaniilKl DaniilKl force-pushed the add-rebase-script branch 7 times, most recently from 4437fe8 to 94a562f Compare April 10, 2026 09:14
@DaniilKl DaniilKl marked this pull request as ready for review April 10, 2026 09:29
@DaniilKl DaniilKl requested a review from macpijan April 10, 2026 09:29
Comment thread .github/workflows/rebase.yml Outdated
@DaniilKl
Copy link
Copy Markdown
Author

I will have to add a few diagrams here, hence, switching to draft.

@DaniilKl DaniilKl marked this pull request as draft April 13, 2026 14:49
@DaniilKl DaniilKl force-pushed the add-rebase-script branch 5 times, most recently from ed03c87 to 55245e6 Compare April 15, 2026 13:27
Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
woodpecker-cli

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
This is because it is being used in other TrenchBoot repos as well but
on other branches because of:

TrenchBoot/grub#32
TrenchBoot/qubes-antievilmaid#15
TrenchBoot/xen#26

IMHO there is no reason to mention every use of this workflow.

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl DaniilKl force-pushed the add-rebase-script branch from 55245e6 to 0de7bf6 Compare April 15, 2026 13:33
@DaniilKl
Copy link
Copy Markdown
Author

DaniilKl commented Apr 15, 2026

I will have to add a few diagrams here, hence, switching to draft.

Moving to "Ready for review" now, I will consider adding the diagrams to TrenchBoot docs instead, as the diagrams will describe an entire CI/CD infrastructure for automatic rebasing in TrenchBoot organization.

This seems to be a good place: https://trenchboot.org/dev-docs/ .

Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/woodpecker-trigger.sh Outdated
Comment thread scripts/woodpecker-trigger.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/woodpecker-trigger.sh Outdated
Comment thread scripts/woodpecker-trigger.sh Outdated
with:
repository: TrenchBoot/.github
path: shared
ref: master
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wouldn't you want the same ref as this workflow was called with?

Copy link
Copy Markdown
Author

@DaniilKl DaniilKl Apr 21, 2026

Choose a reason for hiding this comment

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

No I do not see a reason, unless there is a custom change to the rebase.sh that should be tested. But I have not found the way to redirect to the reusable workflow the ref it was called from. Because the reusable workflow inherits all the environment variables from the parent workflow (such as, for example github.sha, etc.). So for me the only way here is to use inputs to tell the reusable workflow about it, but I do not want to create yet another input just for that.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You are right, I got a little confused with how this would work with reusable workflow (and noticed there are GitHub issues related to exactly this)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No I do not see a reason, unless there is a custom change to the rebase.sh

I can't test it as rebase.sh doesn't exist on master currently :(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Comment thread scripts/woodpecker-trigger.sh Outdated
Comment thread scripts/apply-qubes-patches.sh Outdated
Comment thread README.md Outdated
Comment thread .github/workflows/rebase.yml Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
@DaniilKl
Copy link
Copy Markdown
Author

I will need to do a squash at the end.

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl DaniilKl force-pushed the add-rebase-script branch from 69ac4e4 to ed96075 Compare April 21, 2026 18:19
Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl
Copy link
Copy Markdown
Author

I have found another corner case: 9501536 .

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh
Comment on lines +454 to +455
FIRST_REPO="$1"
FIRST_REPO_BRANCH="$2"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check if at least 2 positional args were passed otherwise it will fail e.g.:

$1: unbound variable
$2: unbound variable

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

-if [[ "${#POSITIONAL_ARGS[@]}" -ne "2" ]]; then
+if [[ "${#POSITIONAL_ARGS[@]}" -lt "2" ]]; then

As we can have 3 or 4 arguments. This check is just to print some more meaningful error than unbound variable

Comment thread .github/workflows/trigger-woodpecker-pipeline.yml Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh Outdated
Comment thread scripts/rebase.sh
Comment thread scripts/rebase.sh Outdated
NAME: ${{ inputs.commit-user-name }}
EMAIL: ${{ inputs.commit-user-email }}
MESSAGE: ${{ inputs.cicd-trigger-resume }}
run: |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we should deal with return code 5 (nothing to rebase). I don't think failing job (red x) would look good. I think in that case rest of the jobs should be skipped

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl DaniilKl force-pushed the add-rebase-script branch from de0c349 to e8f2d46 Compare April 23, 2026 10:05
Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl DaniilKl force-pushed the add-rebase-script branch from e8f2d46 to 8a88744 Compare April 23, 2026 10:08
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.

4 participants