Skip to content

Introduce checkout-to-release script - #117

Open
AndreiRV1 wants to merge 1 commit into
unikraft:mainfrom
AndreiRV1:add-checkout-script
Open

Introduce checkout-to-release script#117
AndreiRV1 wants to merge 1 commit into
unikraft:mainfrom
AndreiRV1:add-checkout-script

Conversation

@AndreiRV1

Copy link
Copy Markdown

Add checkout-to-release script to sync subrepos to a release tag and falls back to the latest tag if a subrepo doesn't have the requested version.

@razvand
razvand requested a review from Copilot July 24, 2026 10:52
@razvand razvand self-assigned this Jul 24, 2026
@razvand
razvand requested a review from StefanJum July 24, 2026 10:52
@razvand razvand added the enhancement New feature or request label Jul 24, 2026
@razvand
razvand requested a review from raresgoidescu July 24, 2026 10:53
@razvand
razvand requested a review from sculamacaz July 24, 2026 10:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new top-level helper script intended to synchronize all checked-out subrepositories under repos/ to a specified RELEASE-* tag, with a fallback mechanism when a tag isn’t present in a given subrepo.

Changes:

  • Introduces checkout-to-release.sh to iterate over known subrepo directories and checkout a requested release tag.
  • Adds a fallback behavior that attempts to checkout a “latest” tag when the requested tag isn’t available.
Comments suppressed due to low confidence (1)

checkout-to-release.sh:83

  • git checkout failures (e.g., dirty worktree / missing tag) are not handled, but the script prints a success message regardless. Also, git rev-parse "$TAG" can resolve non-tag refs, and the fallback tag selection is based on creation date and may pick non-release tags.
            # Check if tag exists locally or on remote
            if git rev-parse "$TAG" >/dev/null 2>&1; then
                git checkout "$TAG" --quiet
                echo "Checked out $TAG for $d"
            else

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread checkout-to-release.sh Outdated
Comment thread checkout-to-release.sh Outdated
Comment on lines +59 to +73
for d in repos/unikraft \
repos/libs/musl \
repos/libs/lwip \
repos/libs/libcxx \
repos/libs/libcxxabi \
repos/libs/libunwind \
repos/libs/compiler-rt \
repos/libs/nginx \
repos/libs/python3 \
repos/libs/click \
repos/libs/libelf \
repos/apps/elfloader \
repos/libs/redis \
repos/libs/wamr \
repos/libs/sqlite; do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks hard to maintain.

Isn't something like this possible?

for d in repos/libs/* repos/apps/* repos/unikraft

@AndreiRV1
AndreiRV1 force-pushed the add-checkout-script branch from 99a36a7 to acc42ce Compare July 24, 2026 11:22
@AndreiRV1

Copy link
Copy Markdown
Author

I applied the suggested changes to make it easier to maintain. Let me know if you have any other thoughts or if there is anything to improve!

@AndreiRV1
AndreiRV1 requested a review from raresgoidescu July 24, 2026 11:25
@raresgoidescu

Copy link
Copy Markdown
Member

Looks good.

Reviewed-by: Rares Goidescu known.as.rares@gmail.com

Comment thread checkout-to-release.sh Outdated
Comment thread checkout-to-release.sh Outdated
Comment thread checkout-to-release.sh Outdated

@StefanJum StefanJum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See the inline comments. Besides that, make sure to be consistent with things like variables quoting etc. Paste the script in https://www.shellcheck.net/ to make sure of that.

Comment thread checkout-to-release.sh Outdated
Comment thread checkout-to-release.sh Outdated
@AndreiRV1
AndreiRV1 force-pushed the add-checkout-script branch from acc42ce to 913b361 Compare July 27, 2026 10:52
@AndreiRV1
AndreiRV1 requested review from StefanJum and spx01 July 27, 2026 10:53
Add checkout-to-release script to sync subrepos to a release tag and falls
back to the latest tag if a subrepo doesn't have the requested version.

Signed-off-by: Andrei Radulescu <andrei.radulescu2703@gmail.com>
@AndreiRV1
AndreiRV1 force-pushed the add-checkout-script branch from 913b361 to 7a32f77 Compare July 31, 2026 05:55
@AndreiRV1
AndreiRV1 marked this pull request as ready for review August 5, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants