Coder Social home page Coder Social logo

buildkite-plugin-linter's People

Contributors

dependabot[bot] avatar james2791 avatar joscha avatar mr-beerkiss avatar pzeballos avatar renovate-bot avatar renovate[bot] avatar tomowatt avatar toolmantim avatar toote avatar ytaben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buildkite-plugin-linter's Issues

Check if version is actually latest

If the tags v1 and v1.0.1 actually target the same commit I get an error Readme version numbers out of date. Latest is v1.0.1
This is because const tags = await git.listTags({ fs, dir: pluginPath }) have no concept of multiple tags being the "same" version.
Is this the intended behaviour?

Somewhat related to #485

The linter fails if it doesn't find an example in the readme

I have a plugin where the linter doesn't find the example in the readme because it's not inside steps: (https://github.com/bugcrowd/test-summary-buildkite-plugin). The linter used to just let that pass with a log message but now it fails. So I guess there's two issues here:

  1. The breaking change of requiring a plugin example in the readme without a version bump
  2. Not detecting the plugin example

Fixing either of them will solve my problem.

Plugin name argument unnecessary

Tt should be unnecessary to configure the linter with --name just so it can search the readme for plugins: ${name}#v.* code blocks, because it's already set in the plugin.yml file. It'll need to handle the org scoping tho, which is currently done via the --name linter argument.

Allow code examples with invalid version tags

Hi! 👋 In the documentation for my Buildkite plugin i'd like to be able to tell users that they can use the BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH feature as described here to get rapid development feedback while making changes to a Buildkite plugin. I want to provide an example in the docs, something like this:

steps:
  - name: ":hiking_boot: Kick off plugin"
    env:
      BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH: "true"
    plugins:
      - ssh://[email protected]/org/bar-buildkite-plugin.git#your-branch-name:
          some_option: foo

However, the linter is complaining that your-branch-name isn't a valid version tag. I mean, that's correct. But it's also pretty annoying. I wonder if folks have a workaround? I could also attempt to implement, e.g., a whitelist of "always valid" version tags, but that is rather a yak shave for what i want to get done right now.

latestVersion finds latest version, not latest release

The logic in readme-version-number-linter.js is to take the highest version numbered tag, when sorted semantically:

const latestVersion = sortedTags[sortedTags.length - 1]

However, this means it often picks non-stable version numbers, like release candidates and alpha/beta versions:

not ok 3 - Readme version numbers out of date. Latest is v3.2.0-alpha.1
 invalid version numbers:
 - v3.1.2

It also means that if the documentation has been prepared for release, and has a version number greater than the latest one, we'll still error (whereas we could check that the version numbers simply aren't older than the latest release to allow this case)

not ok 3 - Readme version numbers out of date. Latest is v3.2.0-alpha.1
 invalid version numbers:
 - v3.2.0

(Note: 3.2.0 is semantically newer than 3.2.0-alpha.1, so this lint also shouldn't say "out of date")

This package implements the sort of logic we could use for this lint

Support for private-repo examples?

In my private repo, I have a README.md with this YAML example block in it.

steps:
  - command: echo foo
    plugins:
      - ssh://[email protected]/improbable/toolshare-buildkite-plugin.git#v0.0.1: {}

It fails linting:

$ docker-compose run --rm lint
Creating toolshare-buildkite-plugin_lint_run ... done
TAP version 13
ok 1 - plugin.yml is valid
not ok 2 - No readme config examples found with plugin id 'improbable/toolshare'. Have you configured the linter with the correct plugin id?
ok 3 - Readme version numbers are up-to-date (v0.0.1)
1..3
# failed 1 of 3 tests
# time=85.235ms

I think this is because the regexes (https://github.com/buildkite-plugins/buildkite-plugin-linter/blob/master/lib/linters/example-linter.js#L80) are not supporting my I-think-legit example...?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency ajv to v8.11.2
  • Update dependency chai to v4.3.7
  • Update buildkite plugin docker-compose to v3.13.0
  • Update Node.js to v19
  • Update buildkite plugin docker-compose to v4
  • Update dependency fs-extra to v11
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

buildkite
.buildkite/pipeline.deploy.yml
  • docker-compose v3.10.0
  • docker-login v2.1.0
  • docker-compose v3.10.0
  • docker-login v2.1.0
  • docker-compose v3.10.0
.buildkite/pipeline.yml
  • docker-compose v3.10.0
  • docker-compose v3.10.0
docker-compose
docker-compose.prod.yml
docker-compose.yml
dockerfile
Dockerfile
  • node 18-alpine@sha256:b3ca07adf425d043e180464aac97cb4f7a566651f77f4ecb87b10c10788644bb
npm
package.json
  • ajv 8.11.0
  • compare-versions 4.1.3
  • isomorphic-git 1.19.0
  • js-yaml 3.14.1
  • tap 14.11.0
  • yargs 15.4.1
  • chai 4.3.6
  • eslint-config-standard 17.0.0
  • eslint-plugin-import 2.26.0
  • eslint-plugin-node 11.1.0
  • eslint-plugin-promise 4.3.1
  • eslint-plugin-standard 4.1.0
  • fs-extra 10.1.0
  • mocha 9.2.0
  • standard 14.3.4

  • Check this box to trigger a request for Renovate to run again on this repository

Runtime linting

Would be nice if we could pass the runtime configuration yaml and the plugin schema yaml to the linter in say a hook to validate if the correct configuration schema was passed. We currently have to validate this in the plugin itself. Or is there already a solution for this?

README version checking is too strict

The README version checking algorithm creates a chicken-and-egg situation that may be problematic for some build processes. In particular, because it requires that the version is exactly the latest semver tag, unless the master build process (after PR merge) produces a new version and updates the README, or each commit within a PR is given the release semver, then either the PR build will fail or the master build will fail.

A flag should be provided to allow PRs to use a newer-than-latest semver in the README examples (changing the check to greater-or-equals instead of just equals).

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

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.

Support for SSH based plugins?

We have our plugin example that pulls from SSH instead of HTTPS and the linter currently doesn't like this example in the README

steps:
  - plugins:
      - ssh://[email protected]/hoteltonight/jenkins-trigger-buildkite-plugin#v0.2:
          job_name: hotelstonight-docker-build
          job_token: hackme
    branches: master

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:babel6). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

linter doesn't work with local plugins

E.g. a readme with:

```yml
steps:
  - command: test.sh
    plugins:
      - ./path/to/plugin: ~
```

and:

version: "3.4"
services:
  lint:
    image: buildkite/plugin-linter
    command: ['--id', './path/to/plugin']
    volumes:
      - ".:/plugin:ro"

does result in a:

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

or am I holding it wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.