Skip to content

ci: update release fetching logic in workflow#3918

Open
officialasishkumar wants to merge 2 commits intov2from
check-for-sanity-v2
Open

ci: update release fetching logic in workflow#3918
officialasishkumar wants to merge 2 commits intov2from
check-for-sanity-v2

Conversation

@officialasishkumar
Copy link
Member

  • Changed the method to fetch the latest release tag from GitHub API to ensure it retrieves the most recent version.
  • Enhanced the curl command to include retry logic for improved reliability during download.

Describe the changes that are made

Links & References

Closes: #[issue number that will be closed through this PR]

  • NA (if very small change like typo, linting, etc.)

🔗 Related PRs

  • NA

🐞 Related Issues

  • NA

📄 Related Documents

  • NA

What type of PR is this? (check all applicable)

  • 📦 Chore
  • 🍕 Feature
  • 🐞 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🔁 CI
  • ⏩ Revert

Added e2e test pipeline?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added comments for hard-to-understand areas?

  • 👍 yes
  • 🙅 no, because the code is self-explanatory

Added to documentation?

  • 📜 README.md
  • 📓 Wiki
  • 🙅 no documentation needed

Are there any sample code or steps to test the changes?

  • 👍 yes, mentioned below
  • 🙅 no, because it is not needed

Self Review done?

  • ✅ yes
  • ❌ no, because I need help

Any relevant screenshots, recordings or logs?

  • NA

🧠 Semantics for PR Title & Branch Name

Please ensure your PR title and branch name follow the Keploy semantics:

📌 PR Semantics Guide
📌 Branch Semantics Guide

Examples:

  • PR Title: fix: patch MongoDB document update bug
  • Branch Name: feat/#1-login-flow (You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)

Additional checklist:

* Changed the method to fetch the latest release tag from GitHub API to ensure it retrieves the most recent version.
* Enhanced the curl command to include retry logic for improved reliability during download.
Copilot AI review requested due to automatic review settings March 12, 2026 09:38
Copy link
Contributor

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

Updates the prepare_and_run GitHub Actions workflow’s logic for downloading the latest Keploy release artifact during CI runs on the v2 branch.

Changes:

  • Switch release tag discovery to GitHub’s /releases/latest endpoint.
  • Add curl retry flags when downloading the release tarball.

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

- name: Upload latest release
run: |
TAG=$(curl -s https://api.github.com/repos/keploy/keploy/releases | jq -r '[.[] | select(.tag_name | startswith("v2"))][0].tag_name')
TAG=$(curl -fsSL "https://api.github.com/repos/keploy/keploy/releases/latest" | jq -r '.tag_name')
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The workflow is triggered only on the v2 branch and previously explicitly selected a tag_name starting with v2. Switching to the /releases/latest endpoint removes that constraint and can fetch a non-v2 release (e.g., v3) if it becomes the latest, causing the workflow to download an incompatible artifact. Consider keeping the v2 filter (with pagination if needed) or at least validate TAG starts with v2 and fail with a clear error if it doesn’t.

Suggested change
TAG=$(curl -fsSL "https://api.github.com/repos/keploy/keploy/releases/latest" | jq -r '.tag_name')
TAG=$(curl -fsSL "https://api.github.com/repos/keploy/keploy/releases/latest" | jq -r '.tag_name')
if [[ "$TAG" != v2* ]]; then
echo "ERROR: Latest release tag '$TAG' is not a v2.* tag; refusing to download incompatible artifact." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
* Changed the branch reference from 'v2' to 'sync-v2-with-v3' for fetching the latest commit hash in the setup-private-parsers action.
* Minor formatting adjustment in the echo command for creating extraparsers.go.
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