Skip to content

Conversation

@krishnakumar4a4
Copy link
Contributor

@krishnakumar4a4 krishnakumar4a4 commented Sep 29, 2025

This pull request introduces improved handling of the STAMPINF_VERSION environment variable for the driver packaging process, ensuring that the stampinf tool correctly sets the DriverVer field when the environment variable is present. It also adds a robust utility for managing environment variables in tests, and updates existing tests to use this utility to ensure isolation and reliability. Additionally, a new test is added to verify the STAMPINF_VERSION override logic. The changes also add the regex crate as a workspace dependency.

Environment variable handling and testing improvements:

  • Added a new with_env utility function for safely setting and restoring environment variables in tests, ensuring test isolation and preventing cross-test contamination. This function is now used throughout all relevant tests. (crates/cargo-wdk/src/main.rs, crates/cargo-wdk/src/actions/build/tests.rs) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

STAMPINF_VERSION environment variable support:

  • Updated the run_stampinf logic so that if the STAMPINF_VERSION environment variable is set and non-empty, the -v argument is omitted, allowing stampinf to read and use the environment variable for the DriverVer field. Otherwise, the default -v * argument is used. (crates/cargo-wdk/src/actions/build/package_task.rs) [1] [2]
  • Added a dedicated test to verify that the presence, absence, or emptiness of STAMPINF_VERSION correctly influences the arguments passed to stampinf. (crates/cargo-wdk/src/actions/build/package_task.rs)

Dependency management:

  • Added the regex crate as a workspace dependency in Cargo.toml for future or current use. (crates/cargo-wdk/Cargo.toml)

Integration test updates:

  • Updated integration tests to use the new with_env utility and to define STAMPINF_VERSION_ENV_VAR for consistency. (crates/cargo-wdk/tests/build_command_test.rs)

These changes collectively improve the reliability of the build process when environment variables are involved, and make the test suite more robust and maintainable.

Copilot AI review requested due to automatic review settings September 29, 2025 17:02
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

This pull request introduces conditional support for overriding the DriverVer version in the stampinf tool through an environment variable when unstable build flags are enabled.

  • Adds conditional logic to allow STAMPINF_VERSION environment variable to override auto-generated driver version
  • Implements parameterized testing to verify the new conditional behavior
  • Updates configuration to support linting and documentation of the new unstable cfg flag

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/cargo-wdk/src/actions/build/package_task.rs Implements conditional DriverVer override logic and adds comprehensive test coverage
crates/cargo-wdk/Cargo.toml Adds linting configuration for unexpected cfgs including the new flag
.cargo/config.toml Documents the new unstable cfg option for discoverability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings September 30, 2025 05:34
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

remove redundant comment

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Krishna Kumar Thokala <[email protected]>
Copilot AI review requested due to automatic review settings October 1, 2025 16:35
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Krishna Kumar Thokala <[email protected]>
Copilot AI review requested due to automatic review settings October 1, 2025 16: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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gurry gurry added the next-release-priority Issues and PRs that should be prioritized to be in the next crates.io release label Oct 2, 2025
Copilot AI review requested due to automatic review settings October 6, 2025 18:22
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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 8, 2025 16:18
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

gurry
gurry previously approved these changes Oct 9, 2025
Copy link
Contributor

@gurry gurry left a comment

Choose a reason for hiding this comment

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

@krishnakumar4a4 looks okay to me as long as you address remaining comments from @wmmc88 and Copilot

Copilot AI review requested due to automatic review settings October 9, 2025 19:08
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 9, 2025 20:11
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 10, 2025 12:52
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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@leon-xd leon-xd left a comment

Choose a reason for hiding this comment

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

LGTM

@gurry gurry enabled auto-merge October 11, 2025 02:35
@gurry gurry added this pull request to the merge queue Oct 11, 2025
Merged via the queue into microsoft:main with commit a8da554 Oct 11, 2025
229 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next-release-priority Issues and PRs that should be prioritized to be in the next crates.io release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants