Skip to content

(WIP) Add PR and run link to version output for PR builds#418

Open
alirana01 wants to merge 2 commits intomasterfrom
pr_version_link
Open

(WIP) Add PR and run link to version output for PR builds#418
alirana01 wants to merge 2 commits intomasterfrom
pr_version_link

Conversation

@alirana01
Copy link
Copy Markdown
Collaborator

@alirana01 alirana01 commented Feb 10, 2026

Summary

When testing binaries from a PR, it can be hard to know exactly which PR and which CI run produced that build. This PR adds the PR link and the GitHub Actions run link to the version string for PR builds only, so eim --version (and the GUI version) show where the binary came from. Release builds are unchanged.

JIRA: EIM-494

image

Why

  • QA and dev can quickly identify the source of a binary when reporting or debugging issues.
  • Running eim --version (CLI) or checking the version in the GUI shows the PR URL and the Actions run URL that produced that build.
  • Release builds are not affected: EIM_PR_LINK is only set on pull_request events, so released binaries still show the plain version (e.g. 0.7.1).

What changed

  • .github/workflows/build.yaml

    • Set workflow-level EIM_PR_LINK (PR URL) for pull_request events.
    • Set EIM_RUN_URL (GitHub Actions run URL) for all runs so PR builds can include it.
  • src-tauri/build.rs

    • Before compile, build a version string from CARGO_PKG_VERSION and, when EIM_PR_LINK is set, append the PR link and (when available) the run link.
    • Emit CARGO_PKG_VERSION so the existing code (CLI and GUI) shows this string without any changes in cli_args.rs, helpers.rs, or utils_commands.rs.

Example output

PR build:

eim 0.7.1 (PR: https://github.com/espressif/idf-im-ui/pull/123, Run: https://github.com/espressif/idf-im-ui/actions/runs/456789)

Release build: unchanged

eim 0.7.1

Made with Cursor

The idea is to add the pr link to the pr builds for version output
This should not impact the release builds. It can help in diagnosing the issues for QA and dev both as they can easily see the source for that binary by using version command to show the PR and the action id and run link which generated that binary.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @alirana01, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the traceability of binaries produced from pull requests by embedding their origin directly into the version information. This enhancement allows QA and development teams to quickly identify which PR and CI run generated a particular build, streamlining debugging and issue reporting. Release builds remain unaffected, maintaining their standard version format.

Highlights

  • Enhanced Version Output for PR Builds: Modified the build process to include the Pull Request (PR) link and GitHub Actions run URL directly in the version string for binaries built from PRs. This makes it easier to trace the origin of a specific build.
  • Conditional Version String Generation: Implemented logic in src-tauri/build.rs to dynamically construct the version string. If EIM_PR_LINK is set (indicating a PR build), the PR URL and optionally the run URL are appended to the standard package version.
  • Environment Variable Configuration: Updated the CI workflow (.github/workflows/build.yaml) to set the EIM_PR_LINK environment variable specifically for pull_request events and EIM_RUN_URL for all runs, ensuring these links are available during PR builds.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src-tauri/build.rs
    • Added logic to read CARGO_PKG_VERSION, EIM_PR_LINK, and EIM_RUN_URL environment variables.
    • Implemented conditional formatting to append PR and run links to the version string if EIM_PR_LINK is present.
    • Emitted the newly constructed version string as CARGO_PKG_VERSION for use by the application.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build.yaml
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@alirana01 alirana01 self-assigned this Feb 10, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds valuable context to PR builds by including the PR and run links in the version string. The implementation is straightforward and correctly uses environment variables to conditionally modify the version. I have one minor suggestion to improve the robustness of the build script.

}
}
// Version string: add PR link and run link when EIM_PR_LINK is set (CI PR builds only)
let pkg_version = std::env::var("CARGO_PKG_VERSION").unwrap();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While CARGO_PKG_VERSION is expected to be set by Cargo, it's a good practice to use expect() with a descriptive message instead of unwrap(). This makes the build script more robust and provides a clearer error message if the environment variable is missing for any unexpected reason, which can aid in debugging.

Suggested change
let pkg_version = std::env::var("CARGO_PKG_VERSION").unwrap();
let pkg_version = std::env::var("CARGO_PKG_VERSION").expect("CARGO_PKG_VERSION must be set by Cargo");

@alirana01 alirana01 changed the title Add PR and run link to version output for PR builds (WIP) Add PR and run link to version output for PR builds Feb 10, 2026
@alirana01 alirana01 changed the title (WIP) Add PR and run link to version output for PR builds Add PR and run link to version output for PR builds Feb 11, 2026
@alirana01 alirana01 changed the title Add PR and run link to version output for PR builds (WIP) Add PR and run link to version output for PR builds Feb 11, 2026
…rsing

Overriding CARGO_PKG_VERSION with the PR/run link string caused Tauri's
generate_context!() to panic because it parses the version as semver.
Emit a dedicated EIM_VERSION_STRING from build.rs instead, and use it
in the three places that display version to users (CLI --version, GUI
app info, telemetry). CARGO_PKG_VERSION stays as valid semver from
Cargo.toml so Tauri works correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant