Add updatecli Configuration for Automated Updating of Package Registry URL Version#1171
Add updatecli Configuration for Automated Updating of Package Registry URL Version#1171JDKurma wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds Updatecli automation: an orchestrator workflow that runs Updatecli (manual, weekday cron, or on updatecli PRs) and chooses diff vs apply mode; SCM values specifying ChangesUpdatecli Automation Setup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/run-updatecli.yml:
- Around line 4-24: Add a GitHub Actions concurrency block to prevent
overlapping runs for this workflow: add a top-level concurrency stanza (or under
the updatecli job) using a stable group name that includes the workflow and
branch/run type (e.g., "updatecli-${{ github.ref }}") and set
cancel-in-progress: true so scheduled and manual runs for the updatecli job
don't overlap; update the workflow's concurrency configuration near the existing
on/permissions/jobs definitions to reference the "updatecli" job context.
- Line 25: Replace the mutable checkout step "uses: actions/checkout@v6" with a
pinned commit SHA and set persist-credentials: false; specifically, locate the
workflow step that contains "uses: actions/checkout@v6" and change it to use the
actions/checkout commit SHA (matching the style used by "updatecli-action") and
add the input "persist-credentials: false" to prevent inheriting repository
credentials in this write-scoped workflow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: eb13ea01-3aee-4ca7-bb81-8ffe56383693
📒 Files selected for processing (3)
.github/workflows/run-updatecli.yml.github/workflows/updatecli/updatecli.d/bump-package-registry-categories-version.yml.github/workflows/updatecli/values.d/scm.yml
| strategy: | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
There was a problem hiding this comment.
Can you please add also dependabot configuration to update these actions? It would be to add something like this:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
open-pull-requests-limit: 2
labels:
- automation
|
i think it will be handy to use a "default" version (hardcoded and updated with this workflow), but also allow the user doing the validation to use an ENV in case it wants to change the version of the source file. WDYT? something like this // validate_datastream_package_categories.go
const (
defaultPackageRegistryTag = "v1.38.0"
)
var (
packageRegistryCategoriesURLTemplate = "https://raw.githubusercontent.com/elastic/package-registry/%s/categories/categories.yml"
)
func packageRegistryCategoriesURL() string {
if u := os.Getenv("PACKAGE_SPEC_REGISTRY_CATEGORIES_TAG"); u != "" {
return fmt.Sprintf(packageRegistryCategoriesURLTemplate, u)
}
return fmt.Sprintf(packageRegistryCategoriesURLTemplate, defaultPackageRegistryTag)
} |
What does this PR do?
Adds updatecli configuration to create a PR on package registry version updates in order to retrieve the latest categories
Local Verification:
Why is it important?
Without some type of upkeep, the package registry URL will become stale with whatever pinned version we keep. To avoid manual busywork, updatecli provides a automated way to periodically check for new package registry versions, make the modification to our URL, and create a PR.
Checklist
I have added test packages totest/packagesthat prove my change is effective.I have added an entry inspec/changelog.yml.Related issues
#1095 (comment)
Summary by CodeRabbit