Skip to content

convert.sh: use remote bisdn-linux HEAD on conversion from kas to repo#156

Merged
ideaship merged 1 commit intomainfrom
jogo_fix_convert_to_yaml
Sep 3, 2025
Merged

convert.sh: use remote bisdn-linux HEAD on conversion from kas to repo#156
ideaship merged 1 commit intomainfrom
jogo_fix_convert_to_yaml

Conversation

@KanjiMonster
Copy link
Contributor

The changelog script currently relies on the generated default.xml's revisions being present in the upstream repository, but the very first commit on creating a release branch is to update the FEEDURI_PREFIX to the release one.

If we then try to generate a default.xml using the HEAD revision, the bisdn-linux commit hash is a local one.

This then breaks the script when it tries to generate a changelog and tries to checkout the new version, where bisdn-linux references a commit not existing yet in the upstream repo.

Fix this by instead using the HEAD revision of the remote's current branch, or main if there isn't one.

Fixes: 92fa3f6 ("scripts: add a proof of concept conversion script")

The changelog script currently relies on the generated default.xml's
revisions being present in the upstream repository, but the very first
commit on creating a release branch is to update the FEEDURI_PREFIX to
the release one.

If we then try to generate a default.xml using the HEAD revision, the
bisdn-linux commit hash is a local one.

This then breaks the script when it tries to generate a changelog and
tries to checkout the new version, where bisdn-linux references a commit
not existing yet in the upstream repo.

Fix this by instead using the HEAD revision of the remote's current
branch, or main if there isn't one.

Fixes: 92fa3f6 ("scripts: add a proof of concept conversion script")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
@KanjiMonster
Copy link
Contributor Author

KanjiMonster commented Sep 3, 2025

To test this try to create a release based on a kas lock file:

./scripts/prepare_release.sh v5.4.0 v5.5.0 http://repo.bisdn.de.s3-eu-central-1.amazonaws.com/latest/generic-x86-64/onie-bisdn-full-generic-x86-64-latest.yaml

Without the fix, it will fail once it tries to checkout the release branch via repo.

Then, switch back to main, delete the branch that was generated:

git checkout main
git branch -D release/v5.5.0

And then apply the changes manually. The script will ensure that the HEAD is a upstream commit so any commits on top will go away, but it does not check for local modifications.

With the fix, it should succeed generating the release branch.

@KanjiMonster
Copy link
Contributor Author

KanjiMonster commented Sep 3, 2025

If you only want to check the modifications, but not do an integration test:

Failing:

git switch -c release/v5.5.0 origin/main
git cherry-pick 53381e6649bb49517a3013ba10c3566f26fe47f3
curl "http://repo.bisdn.de.s3-eu-central-1.amazonaws.com/latest/generic-x86-64/onie-bisdn-full-generic-x86-64-latest.yaml" -o bisdn-linux.lock.yaml
./scripts/convert.sh bisdn-linux.lock.yaml default.xml

If you now look at the updated default.xml, its bisdn-linux will now reference a commit hash that does not exist in this repo upstream, but the cherry-picked commit.

You an check this via e.g. git branch --contains <commit>, which will only print the current branch.

Now do the same basing the release branch on the PR's branch, and the default.xml's bisdn-linux should not reference main's HEAD from the remote.

If you check the branches containing this commit, it should now also list main and the PR branch (if you have the latter checked out).

Copy link
Contributor

@ideaship ideaship left a comment

Choose a reason for hiding this comment

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

LGTM

@ideaship ideaship merged commit be1122c into main Sep 3, 2025
3 checks passed
@ideaship ideaship deleted the jogo_fix_convert_to_yaml branch September 3, 2025 09:38
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