Skip to content

Conversation

@olblak
Copy link
Member

@olblak olblak commented Oct 20, 2025

Adding a new scm of kind "githubsearch".
It's a new scm kind that apply Updatecli manifest on every GitHub repositories discovered by a GitHub search query
Technically speaking, it generates github scm using the GitHub advance search query before

Here is an example

updatecli.yaml
name: Update all Golang version
scms:
  default:
    kind: githubsearch
    spec:
      search: "org:updatecli language:Go archived:false"
      limit: 0
      branch: "^main$"

sources:
  golang:
    name: Get the latest Golang version
    kind: golang
    spec:
      versionfilter:
        kind: semver

        pattern: 1.23.x

targets:
  gomod:
    name: 'Update Golang version in go.mod to {{ source "golang" }}'
    kind: golang/gomod
    spec:
      file: go.mod

  github-action:
    name: 'deps(github-action): Bump Golang version to {{ source "golang" }}'
    kind: yaml
    spec:
      engine: yamlpath
      files:
        - ".github/workflows/*"
      key: '$.jobs.build.steps[?(@.uses =~ /^actions\/setup-go/)].with.go-version'
      searchpattern: true

Then you can run

updatecli diff --config updatecli.yaml
updatecli manifest show --config updatecli.yaml

I made this Updatecli policy that can be used for testing.
This policy parses Rancher GitHub repositories and git branch to identify what files relies on a Golang version that
should be updated.

ghcr.io/olblak/rancherlabs-policies/golang/version

using

updatecli manifest show ghcr.io/olblak/rancherlabs-policies/golang/version:0.1.0
updatecli diff ghcr.io/olblak/rancherlabs-policies/golang/version:0.1.0

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

I made the decision to create a new scm kind "githubsearch" instead of reusing the kind "github"
Even thought the parameters are almost the same, I think it's better from a UX perspective

  • The kind github requires the parameters owner and repository
  • The kind githubsearch requires the parameters search and doesn't support owner/repository

This slightly difference allows the schema validation to trigger an error if we are missing either the search parameter or the owner and repository parameter

Please that the kind githubsearch can achieve the same result using the search repo:owner/repository

Potential improvement

  • Working on this feature makes me realize how the current console UI is aweful to visualize information. We
    • Highlight more scm information
    • Leverage more Pipeline report stored in the updatecli tmp directory (currently experimental feature)
    • Leverage more Udash
  • I think this concept could be useful to the other scm provider.

@olblak olblak added enhancement New feature or request scm-github SCM of type GiHhub labels Oct 20, 2025
@olblak olblak enabled auto-merge (squash) October 24, 2025 13:43
@olblak olblak merged commit 60d57f4 into updatecli:main Oct 24, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scm-github SCM of type GiHhub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant