Skip to content

feat(autodiscovery): add Woodpecker CI plugin#7635

Merged
olblak merged 8 commits intoupdatecli:mainfrom
railgun-0402:feat/woodpecker-autodiscovery
Feb 4, 2026
Merged

feat(autodiscovery): add Woodpecker CI plugin#7635
olblak merged 8 commits intoupdatecli:mainfrom
railgun-0402:feat/woodpecker-autodiscovery

Conversation

@railgun-0402
Copy link
Contributor

Fix #7031

What changed

This PR adds Woodpecker CI autodiscovery support by scanning the following file patterns:

  • .woodpecker/**/*.yml
  • .woodpecker/**/*.yaml
  • .woodpecker.yml
  • .woodpecker.yaml

The crawler parses the Woodpecker pipeline YAML and detects container image references defined via image: (e.g. registry.service.consul:5000/updatecli:0.111.0).

Test

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

go test ./...

Additional Information

Checklist

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

Tradeoff

This implementation focuses on detecting image: fields as plain string values. More advanced cases (templating / anchors / variable interpolation, etc.) are not handled in this PR.

Potential improvement

  • Extend detection for additional Woodpecker image declaration variants (if any) and add fixtures for nested directories / more complex pipelines.

  • Consider expanding support for other related fields if Woodpecker introduces alternative image keys in the future.

@allroundtechie
Copy link

Hi there!
Maybe I am wrong but I think you missed:

  • .woodpecker/*.yml
  • .woodpecker/*.yaml

There are three possible locations for .yaml/.yml files regarding to https://woodpecker-ci.org/docs/usage/workflows

@railgun-0402
Copy link
Contributor Author

Thanks for pointing that out, @allroundtechie! 🙏

You’re right — Woodpecker workflows can live at:

  • root .woodpecker.yml|yaml
  • .woodpecker/*.yml|yaml
  • .woodpecker/**/**/*.yml|yaml

I’ve updated the PR to explicitly cover .woodpecker/*.yaml as well (added a fixture/test), and also added a nested .woodpecker/ fixture to make sure subdirectories are detected too.

@railgun-0402
Copy link
Contributor Author

@olblak
CI seems flaky due to GitHub API rate limiting (TestGetUserInfo / user_test.go:54).

I don’t have permission to re-run workflows from my fork — could a maintainer re-run the failed job? 🙏

@olblak
Copy link
Member

olblak commented Jan 30, 2026

It looks like the UT are failing.

            	            	-      file: '.woodpecker/build.yml'
            	            	+      file: '.woodpecker/build.yaml'
            	            	       key: '$.steps[0].image'
            	Test:       	TestDiscoverManifests/Scenario_5_-_directory_format
        main_test.go:324: 
            	Error Trace:	/home/runner/work/updatecli/updatecli/pkg/plugins/autodiscovery/woodpecker/main_test.go:324
            	Error:      	Not equal: 
            	            	expected: "name: 'deps(woodpecker): bump \"node\" tag'\nsources:\n  lint:\n    name: 'get latest image tag for \"node\"'\n    kind: 'dockerimage'\n    spec:\n      image: 'node'\n      tagfilter: '^\\d*-alpine$'\n      versionfilter:\n        kind: 'semver'\n        pattern: '>=18-alpine'\ntargets:\n  lint:\n    name: 'deps: update Woodpecker image \"node\" to \"{{ source \"lint\" }}\"'\n    kind: 'yaml'\n    spec:\n      file: '.woodpecker/build.yml'\n      key: '$.steps[1].image'\n    sourceid: 'lint'\n    transformers:\n      - addprefix: 'node:'\n"
            	            	actual  : "name: 'deps(woodpecker): bump \"node\" tag'\nsources:\n  lint:\n    name: 'get latest image tag for \"node\"'\n    kind: 'dockerimage'\n    spec:\n      image: 'node'\n      tagfilter: '^\\d*-alpine$'\n      versionfilter:\n        kind: 'semver'\n        pattern: '>=18-alpine'\ntargets:\n  lint:\n    name: 'deps: update Woodpecker image \"node\" to \"{{ source \"lint\" }}\"'\n    kind: 'yaml'\n    spec:\n      file: '.woodpecker/build.yaml'\n      key: '$.steps[1].image'\n    sourceid: 'lint'\n    transformers:\n      - addprefix: 'node:'\n"
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -16,3 +16,3 @@
            	            	     spec:
            	            	-      file: '.woodpecker/build.yml'
            	            	+      file: '.woodpecker/build.yaml'

@railgun-0402
Copy link
Contributor Author

Thanks! You're right — the UT failure is caused by having both
.woodpecker/build.yml and .woodpecker/build.yaml in the same fixture directory.

The autodiscovery currently picks one of them (in this case .yaml), so the
expected manifest (hardcoded to .yml) no longer matches.

I'll adjust the fixtures/tests to avoid ambiguity by separating the .yml and
.yaml cases (so each scenario contains only one workflow file), and push an update.

Remove duplicate build.yml and update test expectations to use build.yaml
@railgun-0402
Copy link
Contributor Author

Hi @olblak,

Thank you for the feedback!

Could you please approve the CI workflow to verify the fix? Thank you!

@olblak olblak added the enhancement New feature or request label Feb 4, 2026
@olblak
Copy link
Member

olblak commented Feb 4, 2026

Thanks @railgun-0402 for the pull request

@olblak olblak merged commit a8aa6e9 into updatecli:main Feb 4, 2026
5 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 woodpeckerci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support Woodpecker CI with autodiscovery

3 participants