-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First attempt at filing bugs if WDK is out-of-date #850
Conversation
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
WalkthroughThis pull request introduces a new GitHub Actions workflow file named Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (3)
.github/workflows/check_wdk.yml (3)
4-4
: Fix incorrect workflow description commentThe current comment describes this as a build workflow, but this workflow actually checks for WDK updates.
-# This workflow performs a build of the project and uploads the result as a build artifact. +# This workflow checks for Windows Driver Kit updates and files issues when updates are needed.
55-61
: Enhance issue creation with more detailsConsider improving the issue creation with more context and automatic assignment.
await github.issues.create({ owner: context.repo.owner, repo: context.repo.repo, title: 'Update the Windows Driver Kit', - body: 'The Windows Driver Kit version in the repository does not match the latest version available on NuGet. Please update the WDK version in the repository to match the latest version available on NuGet.', + body: `## WDK Version Update Required + +Current version: ${process.env.REPO_WDK_VERSION} +Latest version: ${process.env.WDK_VERSION} + +Please update the WDK version in \`wdk.props\` to match the latest version available on NuGet. + +This issue was automatically created by the WDK version check workflow.`, - labels: ['wdk-update'] + labels: ['wdk-update', 'dependencies'], + assignees: ['Alan-Jowett'] });
1-62
: Consider adding version compatibility checksBefore creating an issue for a WDK update, it would be valuable to verify that the latest version is actually compatible with your project. Consider:
- Maintaining a list of known compatible WDK versions
- Adding checks for breaking changes in the WDK release notes
- Including compatibility information in the created issues
This would help prevent unnecessary updates to incompatible versions.
Would you like assistance in implementing these compatibility checks?
🧰 Tools
🪛 actionlint (1.7.4)
20-20: property "skip_check" is not defined in object type {}
(expression)
22-22: property "repository" is not defined in object type {}
(expression)
24-24: property "ref" is not defined in object type {}
(expression)
28-28: workflow command "set-output" was deprecated. use
echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions(deprecated-commands)
37-37: workflow command "set-output" was deprecated. use
echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions(deprecated-commands)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/check_wdk.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/check_wdk.yml
20-20: property "skip_check" is not defined in object type {}
(expression)
22-22: property "repository" is not defined in object type {}
(expression)
24-24: property "ref" is not defined in object type {}
(expression)
28-28: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
37-37: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
run: | | ||
# Get the latest version of the Windows Driver Kit | ||
$packages = nuget list "Microsoft.Windows.WDK.x64" | ||
$packageLine = $package | Where-Object { $_ -match $packageName } | ||
$packageVersion = $packageLine -replace "Microsoft.Windows.WDK.x64", "" | ||
echo "::set-output name=wdk_version::$packageVersion" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix PowerShell script and update deprecated workflow commands
The script has multiple issues:
- The
$package
variable is undefined but used in line 31 - The
set-output
command is deprecated
Apply these fixes:
run: |
# Get the latest version of the Windows Driver Kit
$packages = nuget list "Microsoft.Windows.WDK.x64"
- $packageLine = $package | Where-Object { $_ -match $packageName }
+ $packageLine = $packages | Where-Object { $_ -match "Microsoft.Windows.WDK.x64" }
$packageVersion = $packageLine -replace "Microsoft.Windows.WDK.x64", ""
- echo "::set-output name=wdk_version::$packageVersion"
+ "wdk_version=$packageVersion" >> $env:GITHUB_OUTPUT
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
run: | | |
# Get the latest version of the Windows Driver Kit | |
$packages = nuget list "Microsoft.Windows.WDK.x64" | |
$packageLine = $package | Where-Object { $_ -match $packageName } | |
$packageVersion = $packageLine -replace "Microsoft.Windows.WDK.x64", "" | |
echo "::set-output name=wdk_version::$packageVersion" | |
run: | | |
# Get the latest version of the Windows Driver Kit | |
$packages = nuget list "Microsoft.Windows.WDK.x64" | |
$packageLine = $packages | Where-Object { $_ -match "Microsoft.Windows.WDK.x64" } | |
$packageVersion = $packageLine -replace "Microsoft.Windows.WDK.x64", "" | |
"wdk_version=$packageVersion" >> $env:GITHUB_OUTPUT | |
🧰 Tools
🪛 actionlint (1.7.4)
28-28: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
- name: Check the version of the WDK in the repo | ||
id: check_repo_wdk | ||
run: | | ||
$wdkVersion = (Get-Content -Path .\wdk.props | Select-String -Pattern "<WDKVersion>" | ForEach-Object { $_ -replace "<WDKVersion>", "" -replace "</WDKVersion>", "" }).trim() | ||
echo "::set-output name=repo_wdk_version::$wdkVersion" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling and update deprecated workflow commands
The script needs error handling and uses deprecated commands.
run: |
+ if (-not (Test-Path .\wdk.props)) {
+ Write-Error "wdk.props file not found"
+ exit 1
+ }
$wdkVersion = (Get-Content -Path .\wdk.props | Select-String -Pattern "<WDKVersion>" | ForEach-Object { $_ -replace "<WDKVersion>", "" -replace "</WDKVersion>", "" }).trim()
- echo "::set-output name=repo_wdk_version::$wdkVersion"
+ "repo_wdk_version=$wdkVersion" >> $env:GITHUB_OUTPUT
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Check the version of the WDK in the repo | |
id: check_repo_wdk | |
run: | | |
$wdkVersion = (Get-Content -Path .\wdk.props | Select-String -Pattern "<WDKVersion>" | ForEach-Object { $_ -replace "<WDKVersion>", "" -replace "</WDKVersion>", "" }).trim() | |
echo "::set-output name=repo_wdk_version::$wdkVersion" | |
- name: Check the version of the WDK in the repo | |
id: check_repo_wdk | |
run: | | |
if (-not (Test-Path .\wdk.props)) { | |
Write-Error "wdk.props file not found" | |
exit 1 | |
} | |
$wdkVersion = (Get-Content -Path .\wdk.props | Select-String -Pattern "<WDKVersion>" | ForEach-Object { $_ -replace "<WDKVersion>", "" -replace "</WDKVersion>", "" }).trim() | |
"repo_wdk_version=$wdkVersion" >> $env:GITHUB_OUTPUT | |
🧰 Tools
🪛 actionlint (1.7.4)
37-37: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
if: steps.skip_check.outputs.should_skip != 'true' | ||
with: | ||
repository: ${{inputs.repository}} | ||
submodules: 'recursive' | ||
ref: ${{inputs.ref}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix workflow configuration issues
Several critical issues need to be addressed:
- The
skip_check
step is referenced but not defined - The workflow uses undefined inputs (
repository
andref
)
Either:
- Define the inputs in the workflow:
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
+ inputs:
+ repository:
+ description: 'Repository to check'
+ required: false
+ default: ${{ github.repository }}
+ ref:
+ description: 'Git ref to check'
+ required: false
+ default: ${{ github.ref }}
Or:
2. Remove the unused inputs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- if: steps.skip_check.outputs.should_skip != 'true'
with:
- repository: ${{inputs.repository}}
submodules: 'recursive'
- ref: ${{inputs.ref}}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if: steps.skip_check.outputs.should_skip != 'true' | |
with: | |
repository: ${{inputs.repository}} | |
submodules: 'recursive' | |
ref: ${{inputs.ref}} | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
with: | |
submodules: 'recursive' |
🧰 Tools
🪛 actionlint (1.7.4)
20-20: property "skip_check" is not defined in object type {}
(expression)
22-22: property "repository" is not defined in object type {}
(expression)
24-24: property "ref" is not defined in object type {}
(expression)
Description
Describe the purpose of and changes within this Pull Request.
Testing
Do any existing tests cover this change? Are new tests needed?
Documentation
Is there any documentation impact for this change?
Installation
Is there any installer impact for this change?
Summary by CodeRabbit