-
Notifications
You must be signed in to change notification settings - Fork 0
fix(github-workflows): Fix dependabot options and generation #282
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
Conversation
Also added a test to ensure functionality.
526b160 to
bb84375
Compare
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.
Pull request overview
This PR improves Dependabot workflow generation in the GitHub workflows module by updating how Dependabot options are serialized and by adding a verification test to lock in the expected dependabot.yml output (including registries, updates, and update groups).
Changes:
- Updated Dependabot workflow writer to conditionally emit
registriesandupdatessections and to serialize per-update fields (ecosystem, directory, registries, groups, schedule, PR limits). - Made
DependabotUpdate.Registriesoptional (no longerrequired) to allow simpler update definitions. - Added a new
DependabotBuildtest build + verification test and verified output to validate Dependabot YAML generation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| DecSm.Atom.Module.GithubWorkflows/Generation/Options/DependabotOptions.cs | Makes DependabotUpdate.Registries optional to support updates without registries. |
| DecSm.Atom.Module.GithubWorkflows/Generation/DependabotWorkflowWriter.cs | Adjusts Dependabot YAML serialization logic for registries/updates/groups/schedule. |
| DecSm.Atom.Module.GithubWorkflows.Tests/Workflows/WorkflowTests.cs | Adds a Dependabot workflow generation verification test and .github path handling. |
| DecSm.Atom.Module.GithubWorkflows.Tests/Workflows/WorkflowTests.DependabotBuild_GeneratesWorkflow.verified.txt | Adds the approved/verified Dependabot YAML output for snapshot testing. |
| DecSm.Atom.Module.GithubWorkflows.Tests/Workflows/DependabotBuild.cs | Introduces a build definition used by the new Dependabot workflow generation test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DecSm.Atom.Module.GithubWorkflows/Generation/DependabotWorkflowWriter.cs
Outdated
Show resolved
Hide resolved
DecSm.Atom.Module.GithubWorkflows/Generation/DependabotWorkflowWriter.cs
Show resolved
Hide resolved
DecSm.Atom.Module.GithubWorkflows/Generation/DependabotWorkflowWriter.cs
Show resolved
Hide resolved
Updated `DependabotWorkflowWriter` to generate registry types dynamically based on registry configuration. Adjusted tests to verify the change.
Ensured `DependabotWorkflowWriter` correctly skips groups with empty or null patterns during workflow generation. Prevented unnecessary "patterns:" section writing for such cases, improving output clarity.
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.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Also added a test to ensure functionality.
This pull request introduces a new test and workflow generation for Dependabot integration, along with improvements to how Dependabot workflows are written and verified. The main focus is on supporting custom registries, update groups, and more accurate serialization of workflow options.
Dependabot workflow integration and test enhancements:
DependabotBuildclass inDecSm.Atom.Module.GithubWorkflows.Tests/Workflows/DependabotBuild.csto define and generate a Dependabot workflow with custom registries, updates, and groups.DependabotBuild_GeneratesWorkflowinWorkflowTests.csto verify that the Dependabot workflow is generated correctly and matches the expected output.WorkflowTests.DependabotBuild_GeneratesWorkflow.verified.txtto validate the workflow generation, including registries and update groups.Dependabot workflow writer improvements:
DependabotWorkflowWriter.csto ensure registries and updates are only written when present, and improved serialization of update properties such as ecosystem, directory, registries, groups, schedule, and pull request limits. [1] [2] [3]Minor code adjustments:
DependabotUpdaterecord inDependabotOptions.csto makeRegistriesproperty optional instead of required, allowing for more flexible workflow definitions.DependabotDirproperty inWorkflowTests.csfor platform-specific directory handling.