tools/plugout/README.md
This tool ensures that plugin versions in Chainlink's plugin YAML files stay in sync with the versions defined in go.mod.
The Chainlink core node uses plugin whose plugin definitions are stored in YAML files (./plugins/plugins.*.yaml). Some of these plugins, like chainlink-data-streams, chainlink-feeds, and chainlink-solana, are also defined as dependencies in the go.mod file as their packages are used by the core node software.
When updating a plugin's version in go.mod (if it exists there), the corresponding gitRef field in the plugin YAML files should also be updated to maintain consistency. This tool automates the checking and synchronization process.
To verify if all plugin versions in YAML files match their corresponding versions in go.mod:
go run ./tools/plugout/
The tool will report any mismatches but won't make changes. It will exit with code 1 if there are mismatches.
To automatically update the gitRef values in the plugin YAML files to match go.mod versions:
go run ./tools/plugout/ --update
--go-mod <path>: Path to the go.mod file (default: ./go.mod)--ignore-module <module-uri>: Go module URIs to ignore (can be specified multiple times)--plugin-file <file-path>: Plugin YAML file to check (can be specified multiple times)--update: Write the gitRef using the go.mod version for matching pluginsCheck in a custom plugin file:
go run ./tools/plugout/ --plugin-file ./plugins/plugins.custom.yaml
Update plugin references in multiple files:
go run ./tools/plugout/ --update --plugin-file ./plugins/plugins.public.yaml --plugin-file ./plugins/plugins.private.yaml
This tool is integrated into the CI pipeline to ensure that plugin versions remain in sync. If the job fails, it indicates that there are version mismatches between go.mod and the plugin YAML files.
To resolve a failed build:
--update flag to update the plugin YAML filesgo.mod is a pseudo-version (e.g., v0.1.1-0.20250325191518-036bb568a69d), the tool will extract the commit hash part (036bb568a69d) for comparison with the gitRef in the plugins manifest. For a valid match, either: