GithubHelp home page GithubHelp logo

commitlint-orb's Introduction

Conventional Changelog

Build status Coverage status

Generate a CHANGELOG from git metadata.

About this Repo

The conventional-changelog repo is managed as a monorepo; it's composed of many npm packages.

The original conventional-changelog/conventional-changelog API repo can be found in packages/conventional-changelog.

Getting started

It's recommended you use the high level commit-and-tag-version library, which is a drop-in replacement for npm's version command, handling automated version bumping, tagging and CHANGELOG generation.

Alternatively, if you'd like to move towards completely automating your release process as an output from CI/CD, consider using semantic-release.

You can also use one of the plugins if you are already using the tool:

Plugins Supporting Conventional Changelog

Modules Important to Conventional Changelog Ecosystem

Node Support Policy

We only support Long-Term Support versions of Node.

We specifically limit our support to LTS versions of Node, not because this package won't work on other versions, but because we have a limited amount of time, and supporting LTS offers the greatest return on that investment.

It's possible this package will work correctly on newer versions of Node. It may even be possible to use this package on older versions of Node, though that's more unlikely as we'll make every effort to take advantage of features available in the oldest LTS version we support.

As each Node LTS version reaches its end-of-life we will remove that version from the node engines property of our package's package.json file. Removing a Node version is considered a breaking change and will entail the publishing of a new major version of this package. We will not accept any requests to support an end-of-life version of Node. Any merge requests or issues supporting an end-of-life version of Node will be closed.

We will accept code that allows this package to run on newer, non-LTS, versions of Node. Furthermore, we will attempt to ensure our own changes work on the latest version of Node. To help in that commitment, our continuous integration setup runs against all LTS versions of Node in addition the most recent Node release; called current.

JavaScript package managers should allow you to install this package with any version of Node, with, at most, a warning if your version of Node does not fall within the range specified by our node engines property. If you encounter issues installing this package, please report the issue to your package manager.

commitlint-orb's People

Contributors

bycedric avatar escapedcat avatar jgresty avatar kyletryon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commitlint-orb's Issues

Fails using default node version

Orb version: 1.0.0

What happened:

Running the commitlint job without overwriting node-version will fail with the error:

file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:127
        throw err;
        ^

TypeError: Object.hasOwn is not a function
    at main (file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:167:16)

Expected behavior:

Successful run without overriding settings

Additional Information:

The default version (16) is EOL anyway so should be updated.

This can be easily worked around by specifying a node-version parameter, however it should be working without needing to do that.

Orb v1.0.0 throwing a `TypeError: Object.hasOwn is not a function`

Orb version

Version: 1.0

What happened:

Our (internal) projects that use this Orb are failing with the following error output:

short version:

npm notice 
npm notice New major version of npm available! 7.19.1 -> 10.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.2
npm notice Run npm install -g [email protected] to update!
npm notice 
file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:127
        throw err;
        ^

TypeError: Object.hasOwn is not a function
    at main (file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:167:16)

Exited with code exit status 1

full version:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=16.17' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@commitlint/[email protected]',
npm WARN EBADENGINE   required: { node: '>=v18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=16.10' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=16.17.0' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '^14.17.0 || ^16.13.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.5.0', npm: '7.19.1' }
npm WARN EBADENGINE }

added 137 packages, and audited 138 packages in 5s

28 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New major version of npm available! 7.19.1 -> 10.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.2
npm notice Run npm install -g [email protected] to update!
npm notice 
file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:127
        throw err;
        ^

TypeError: Object.hasOwn is not a function
    at main (file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:167:16)

Exited with code exit status 1

Expected behavior:

Run the commit linting correctly.

Additional information

This is how our .circleci/config.yml looks like (the first part):

version: 2.1

orbs:
  prodsec: snyk/prodsec-orb@1
  publish: snyk/publish@1
  deploy: snyk/deploy@2
  commitlint: conventional-changelog/[email protected] #< import
  snyk: snyk/snyk@1

max-count: 1 seems to have no effect

Orb version:

1.0.0

What happened:

Setting

- commitlint/lint:
    max-count: 1

seems to have no effect. Commitlint just runs over every commit

Expected behavior:

Only the latest commit should be linted

commitlint orb is generating fatal: unknown commit main error

Orb version:

1.0.0

What happened:

The circle ci workflow generates the error that I attached. I also saw that the repo for commitlint repo has a failed circle ci so am gussing there is an issue.

Expected behavior:

It should have linted my commit messages but it just generates the error above and exit

Additional Information:

image

exit code 141 for PRs with many commits due to `pipefail`

Orb version: 1.0.0

What happened:

When opening a PR with many commits (~400, in my case, due to importing another repo), the orb fails more or less silently with an exit code 141.
The underlying reason for this is that CircleCI runs /bin/bash -eo pipefail as the default shell, with which the lint script is being invoked.

Then, this command fails because it's using head, which closes the (reading end of) the pipe before git cherry returned all the data, which makes the whole pipeline fail.

This only happens for PRs with many commits, as otherwise git cherry returns before head closes the pipe.

There's a couple of different options to mitigate the issue:

  • The orb could specify the shell parameter in it's run block and set it to something like /bin/bash only. This will turn off pipefail globally.
  • The script itself could turn off pipefail with a set +o pipefail anywhere within the script, potentially even right before the offending line, and potentially also turn it on again directly afterwards with a set -o pipefail
  • The script could use a different command than head, one that doesn't close the pipe before all data is read. For example, sed could be used.

I'm happy to open a PR for any of these, but wanted to inquire as to if there's any preference for the solution!

Allow use of private `configs`

I would like to be able to use commitlint configs from private packages or repositories.

I believe this is not currently possible for the following reasons:

  • Passing NPM_TOKEN environment variable through contexts or project configuration is not sufficient, because without the -E switch, sudo drops environment variables.
  • Even if -E switch was used, any .npmrc config present in the project would not be read.
  • The orb doesn't allow overriding the executor or the docker image, so I cannot use an image which running as root such as node:18.14
  • AFAICT npm doesn't allow passing _authToken on the CLI, meaning I cannot piggy-back the configs parameter to inject CLI options.
  • I can't attach a workspace with node_modules where I would have previously installed the private package.
  • I can't write a custom job re-using a command from the orb, because there are none.

I will gladly open a PR to address this, but I'd like to know what would be your favorite method of solving this.

Regards,

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.