Skip to content

Conversation

ausias-armesto
Copy link
Contributor

@ausias-armesto ausias-armesto commented Jul 16, 2025

  • Using wrong branch when creating release
  • Using wrong folder when downloading artifacts

@ausias-armesto ausias-armesto requested review from Copilot and a team July 16, 2025 08:27
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

📝 Walkthrough

Walkthrough

The changes update two files: a GitHub Actions workflow now checks out the base branch instead of the head branch during release creation, and a shell script now uses the current working directory instead of the script's directory for its operations. No other logic or exported entities were modified.

Changes

File(s) Change Summary
.github/workflows/create-release.yaml Modified the checkout step to use base_branch instead of head_branch for the Git ref.
scripts/download-workflow-binaries.sh Changed variable mydir to use the current working directory instead of the script's location.

Suggested labels

toolchain, release

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR corrects branch references when creating a release by adjusting script directory resolution and checkout parameters.

  • Simplify mydir assignment in the download script.
  • Change the checkout ref in the release workflow to use base_branch instead of head_branch.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/download-workflow-binaries.sh Switched mydir from script’s directory to current working dir
.github/workflows/create-release.yaml Updated checkout ref input from head_branch to base_branch
Comments suppressed due to low confidence (2)

.github/workflows/create-release.yaml:38

  • Ensure that inputs.base_branch is declared in the workflow’s inputs section; otherwise this checkout step will fail. If it’s not defined, add a base_branch input or provide a default.
          ref: ${{ inputs.base_branch }}

scripts/download-workflow-binaries.sh:22

  • Reverting to pwd -P may break relative path resolution when the script is run from outside its directory. Consider restoring the previous logic using ${BASH_SOURCE[0]} to consistently point at the script’s location.
mydir=$(pwd -P)

@github-actions github-actions bot added the toolchain Developer and product happiness label Jul 16, 2025
@ausias-armesto ausias-armesto changed the title fix: Create release using wrong branch fix: Using wrong branch when creating release Jul 16, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
scripts/download-workflow-binaries.sh (1)

20-23: Use repo root instead of $PWD to make the script location-agnostic

pwd -P only works when the caller’s working directory is the repository root (as is the case in create-release.yaml).
If someone runs this helper from a sub-directory the paths defined later (dist/...) will be created in the wrong place.

-mydir=$(pwd -P)
+mydir=$(git rev-parse --show-toplevel)

git rev-parse --show-toplevel is cheap, resolves symlinks, and always returns the repository root, keeping the script robust no matter where it is invoked from.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86df882 and b311af8.

📒 Files selected for processing (2)
  • .github/workflows/create-release.yaml (1 hunks)
  • scripts/download-workflow-binaries.sh (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:0-0
Timestamp: 2024-11-26T17:47:21.777Z
Learning: In `.github/workflows/build-binaries.yaml`, when writing shell scripts in GitHub Actions workflows, the user prefers to set environment variables individually rather than grouping them together.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6379
File: .github/scripts/immutable-files-check.sh:1-1
Timestamp: 2024-07-11T12:39:43.940Z
Learning: The `git diff --name-only HEAD` command is used to check for changes between the working directory and the last commit, which is appropriate for preventing committed changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6379
File: .github/scripts/immutable-files-check.sh:1-1
Timestamp: 2024-10-09T06:16:23.638Z
Learning: The `git diff --name-only HEAD` command is used to check for changes between the working directory and the last commit, which is appropriate for preventing committed changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
.github/workflows/create-release.yaml (3)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
scripts/download-workflow-binaries.sh (5)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:0-0
Timestamp: 2024-11-26T17:47:21.777Z
Learning: In `.github/workflows/build-binaries.yaml`, when writing shell scripts in GitHub Actions workflows, the user prefers to set environment variables individually rather than grouping them together.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7297
File: scripts/download-workflow-binaries.sh:0-0
Timestamp: 2025-07-11T09:09:56.528Z
Learning: In the hoprnet repository, each ZIP artifact downloaded by scripts/download-workflow-binaries.sh contains only a single file with the same name as the artifact. This means there's no risk of file collisions when extracting multiple ZIP files into a shared directory, as each artifact produces only one uniquely named file.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:83-95
Timestamp: 2025-06-30T08:36:01.731Z
Learning: The self-hosted-hoprnet-small runners in the hoprnet repository have GitHub CLI (gh) pre-installed and available for use in workflows.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Pre-commit / Pre-commit
  • GitHub Check: Zizmor / Zizmor
  • GitHub Check: Lint / Lint
  • GitHub Check: Audit / Audit
🔇 Additional comments (1)
.github/workflows/create-release.yaml (1)

38-38: Checkout on base_branch looks correct – double-check release version lives there

Switching the checkout ref to ${{ inputs.base_branch }} prevents releases from being built off un-merged PR code. 👍
Please ensure that the version bump commit (read by get-current-version.sh) is guaranteed to be present on the base branch before this workflow runs, otherwise the tag step will reference an outdated commit.

@ausias-armesto ausias-armesto merged commit 9ef5581 into master Jul 16, 2025
21 checks passed
@ausias-armesto ausias-armesto deleted the ausias/fix-download-artifacts branch July 16, 2025 08:30
@ausias-armesto ausias-armesto added this to the 3.0.0-rc.1 milestone Jul 16, 2025
@ausias-armesto ausias-armesto linked an issue Jul 23, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain Developer and product happiness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create OS packages for publishing and distributing hoprnet
2 participants