buildkite-plugins / buildkite-plugin-linter

✨ A linter for your Buildkite plugins
MIT License
7 stars 9 forks source link

Linter doesn't support plugin tags/versions not prefixed with `v` #478

Closed AliSoftware closed 1 year ago

AliSoftware commented 1 year ago

For one of our plugin, we don't use the v prefix for our tags and versioning (i.e. we use tag named 1.2.3, not v1.2.3)

This breaks the plugin-linter when it tries to find an example in our README.md referencing the plugin. This is because the code of the linter explicitly expects the refMatch to start with #v, so our README example, while using the correct tag (the one really used in our repo, without the v), doesn't get detected by the linter.

For example, when the example in our README looks like this:

steps:
  - command: install_gems
    plugins:
      - automattic/a8c-ci-toolkit#2.16.0:
          bucket: a8c-ci-cache # optional

Then the linter fails with the following:

ok 1 - plugin.yml configuration is valid
not ok 2 - No readme config examples found with plugin id 'automattic/a8c-ci-toolkit'. Have you configured the linter with the correct plugin id?
ok 3 - Readme version numbers are up-to-date (2.16.0)

If I replace #2.16.0 with #v2.16.0 in the README example, then the linter becomes happy and goes all green… but that now makes our example incorrect, as our tag is 2.16.0, not v2.16.0.

pzeballos commented 1 year ago

Thanks @AliSoftware for raising this! you are correct and we should also support when no v prefix is used. I've just merged a change for this, and we'll probably do a new release this week.

AliSoftware commented 1 year ago

I've just merged a change for this

Thanks a lot for your reactivity in fixing this @pzeballos! ❤️

and we'll probably do a new release this week.

Lovely, looking forward to it!


Btw, I was willing to check this fix ahead of time, to confirm you that it fixed our issue before you do that release, since your README is suggesting that it would be possible to test latest master:

Master is built and tested automatically, and pushes a new image to buildkite/plugin-linter on Docker Hub

But in practice, it seems like the latest image on Dockerhub is still one from 22 days ago; so maybe a latest build isn't pushed to Docker Hub automatically on every commit to master after all?

As such, I'm guessing you you might want to:

AliSoftware commented 1 year ago

Update: I ended up cloning the repo and running docker build . to build master locally, then referenced that locally-built image in our docker run invocation of the plugin linter. I am now happy to properly confirm that your fix indeed solved our issue 🙂 🎉

pzeballos commented 1 year ago

Hey @AliSoftware! we needed to update the pipeline to use docker compose v2 😅 I merged #480 that fixed this, and you can see the image in dockerhub now 🙂 Sorry for the trouble! 🙏🏻

I am now happy to properly confirm that your fix indeed solved our issue slightly_smiling_face tada

Woo-hoo! 🎉

pzeballos commented 1 year ago

Hey @AliSoftware! we did a release of the plugin https://github.com/buildkite-plugins/buildkite-plugin-linter/releases/tag/v2.0.4 :)

AliSoftware commented 1 year ago

Thank you! ❤️