Skip to content
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

fix(github): Support redis/argocd-extension-installer to Renovate #3106

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,20 @@
"commands": ["./scripts/renovate-bump-version.sh {{depName}}"]
}
},
{
"matchPackagePatterns": ["argoprojlabs/argocd-extension-installer"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ref: #3072 (comment)

           "prTitle": "chore(deps): update quay.io/argoprojlabs/argocd-extension-installer docker tag to v0.0.8",
           "upgrades": [
             {
               "datasource": "docker",
               "depName": "quay.io/argoprojlabs/argocd-extension-installer",
               "displayPending": "",
               "fixedVersion": "v0.0.5",
               "currentVersion": "v0.0.5",
               "currentValue": "v0.0.5",
               "newValue": "v0.0.8",
               "newVersion": "v0.0.8",
               "packageFile": "charts/argo-cd/values.yaml",
               "updateType": "patch",
               "packageName": "quay.io/argoprojlabs/argocd-extension-installer"
             }
           ]

"commitMessagePrefix": "chore({{{replace '*' 'argo-cd' depName}}}):",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmmm ugly but it works for now, unless other argoproj (argo-workflows, agro-events, etc.) starts using the same image tags ....? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Did you go through this list here?
https://docs.renovatebot.com/templates/

I'd start with either parentDir or somerhing based on packageFile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for your review. Oh there are many convenient ones. 😮 I will fix. 🙋

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a commit for this. 🙏
7f74bba

"postUpgradeTasks": {
"commands": ["./scripts/renovate-bump-version.sh {{depName}}"]
}
},
{
"matchPackagePatterns": ["redis-ha"],
"enabled": false
},
{
"matchPackagePatterns": ["public.ecr.aws/bitnami/redis-exporter"],
"commitMessagePrefix": "chore({{{replace 'public.ecr.aws/' '' depName}}}):",
"commitMessagePrefix": "chore({{{replace '*' 'argo-cd' depName}}}):",
"postUpgradeTasks": {
"commands": ["./scripts/renovate-bump-version.sh {{depName}}"]
}
Expand Down
9 changes: 8 additions & 1 deletion scripts/renovate-bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ chartName=$(echo "$depName" | sed -e "s+^argoproj/++" -e "s+^argoproj-labs/++")
echo "Changed chart name is: $chartName"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should refactor the whole script:

  • Add more input parameters
    • Chart name (e.g. via parentDir)
    • Dependency name
    • New version of the dependency
      (as a replacement of appVersion=$(grep '^appVersion:' "${parentDir}/Chart.yaml" | awk '{print $2}'))
  • Do not hardcode the line description: Bump ${chartName} to ${appVersion}"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for your feedback. I will try to refactor. 📝

echo "----------------------------------------"

parentDir="charts/${chartName}"
case "${chartName}" in
*"redis"*|*"argocd-extension-installer")
parentDir="charts/argo-cd"
;;
*)
parentDir="charts/${chartName}"
;;
esac

# Bump the chart version by one patch version
version=$(grep '^version:' "${parentDir}/Chart.yaml" | awk '{print $2}')
Expand Down
Loading