GithubHelp home page GithubHelp logo

intuit / auto Goto Github PK

View Code? Open in Web Editor NEW
2.2K 17.0 200.0 61.42 MB

Generate releases based on semantic version labels on pull requests.

Home Page: https://intuit.github.io/auto/

License: MIT License

TypeScript 98.90% JavaScript 1.02% Ruby 0.09%
release auto-release github slack jira releases publishing hack hacktoberfest

auto's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto's Issues

Strictly validate autorc config before any release

Is your feature request related to a problem? Please describe.

A few of us at Artsy are working on migrating a lot of repos over to use auto-release. In a batch session, I somehow managed to mess up the config and used noReleaseLabels instead of skipReleaseLabels on several of the projects. This caused some unnecessary releases.

Describe the solution you'd like

I think the config should be strictly validated. If there are values present that aren't a part of the config (i.e. noReleaseLabels), the release process should fail. Invalid configuration likely means someone is in for a bad time. Similarly if a config object doesn't match an expected type, etc. It seems like there's a start to a json schema that could be used for this purpose (auto-rc.json).

Describe alternatives you've considered

If you want to take a lighter approach I'd recommend at the very least having a validate command that checks the validity of the configuration.

use pr-check

Is your feature request related to a problem? Please describe.

use the platform!

v2 failing due to unconfigured git user

Describe the bug

When running auto shipit v2 is failing unless you explicitly set the git user and password.

Here's a passing build with v1:
https://circleci.com/gh/artsy/renovate-config/727?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

and a failing build with v2 right after updating:
https://circleci.com/gh/artsy/renovate-config/737?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

To Reproduce

Updating to v2, ???

Expected behavior

Successful deploy without config change

Additional context

Having worked with process spawning, I suspect this is likely due to the git process not retaining its envs and context. I'm pretty sure this line is the culprit. PR inbound.

Init prompt for changelog labels

Is your feature request related to a problem? Please describe.

right now you can only configure a few changelog title even though the API supports as many as you want.

Add more prompts to init to get n labels from a user

Factor CLI logic out of main

Is your feature request related to a problem? Please describe.

right a bunch of logic lives in the CLI bin/auto.ts this should be moved to a main function. the CLI should only be a CLI

Switch package to monorepo

Is your feature request related to a problem? Please describe.

Switch to @autorelease org.

Probably means renaming the repo too. I can help with this if you decide to do it @adierkens

  • @autorelease/cli
  • @autorelease/core

Add docs for the .autorc

Add some docs/examples around the .autorc file. It's referenced in the docs, but not really an example anywhere

just prerelease label

Is your feature request related to a problem? Please describe.

I want to be able to publish a prerelease without using patch, minor or major. this should also publish under the alpha preid

Describe the solution you'd like

When there is just the prerelease label have auto version return prerleease

Better Monorepo Package parsing

Is your feature request related to a problem? Please describe.

Currently changedPackages only considers packages in the /packages/ directory. This is the behavior of lerna-changelog the last time I looked.

Describe the solution you'd like

Support packages in any directory

Improve Errors

Is your feature request related to a problem? Please describe.

If i don't have the neccasary environment variables auto should throw early and provide nice error messages with links to places to get tokens if possible.

github token printed in verbose mode

Describe the bug

When printing out configuration via verbose mode it prints out the github token. If you're attempting to debug an issue on public CI this'll expose credentials to the public.

To Reproduce

Run auto shipit --very-verbose

Expected behavior

The github token should be sanitized or removed.

Screenshots

image

(this token was invalidated)

Document using API directly

Is your feature request related to a problem? Please describe.

how do you use auto-release without the CLI

Use npm as version source of truth

Is your feature request related to a problem? Please describe.

We've had a few issues where a deployment fails because a particular version is already deployed. This isn't normal process that auto-release should come across... but it does happen. We had a bug last night and someone decided to manually deploy to npm without bumping the package.json version. That caused everything to get into a bad state that wasn't resolved until we manually bumped the version.

Describe the solution you'd like

Continue to update the version field in the package.json, but use npm's version as the source of truth. Give a warning if there's a missmatch, but update the version based off of the one on npm, not the one in the package.json.

Bundle Binary

Is your feature request related to a problem? Please describe.

auto should be bundled as a binary so that it can be distributed and consumed by other package ecosystems. (brew, apt-get, bower, whatever java uses)

possible bundlers:

need to figure out interop with plugins

init flag to just set up just labels

Is your feature request related to a problem? Please describe.

right now the init takes you through a bunch of options. a --labels flag to skip most setup and just setup the labels would be nice

meta CLI

Is your feature request related to a problem? Please describe.

once #31 is done. create meta CLI that does the publishing for you. This will be used in github actions

Tappable auto

Is your feature request related to a problem? Please describe.

To facilitate other languages and more cool features we should make auto tappable.

Some hooks that might be useful:

  • construct - tap into constructor creation, throw errors if secrets aren't present
  • getUser - get git user
  • getPreviousVersion - access package.json/pom.xml for previous version
  • getRepository - get owner/repo
  • publish - publish the package

Prereleases should publish under next tag

Is your feature request related to a problem? Please describe.

Right now if you add a prerelease label it will make a prerelease version but it will publsih the prerelease to latest.

Describe the solution you'd like

publish under --preid=alpha

Still issues where commands fail but CI is reported as passing

Describe the bug

There are still many instances where commands fail but CI doesn't exit.

auto pr-check when some github response gives an error

https://circleci.com/gh/artsy/renovate-config/830?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

auto shipit when an npm package fails to be published

https://circleci.com/gh/artsy/reaction/22172?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Expected behavior

CI Task fails appropriately

Auto configure username and email

Is your feature request related to a problem? Please describe.

when setting it up i always need to do something like

git config --global user.email "[email protected]"
git config --global user.name "Andrew Lisowski"

it would be way better if those aren't set it tries to set them from package.json/pom.xml/etc.

Better type def for CLI args

Right now it basically has all type as possible available. It would be awesome if we could define an interface for each command and get rid of some !s

NOTE: I've spent hours trying to get this to work just right but haven't really gotten close at all

Patching old major releases

Is your feature request related to a problem? Please describe.

"Something I've been thinking about (and I'm not sure if this is ever a thing we'd support) is the potential for releases that aren't master (or the main branch). Up until this point, we've always assumed that there's 1 path for releases to take -- and they're always linear (using the latest version on npm or github).

What happens in the case of needing to patch a previous release? (1.x has a bug, master is on 2.x but you want to patch 1.x w/ a fix too) If we're going off of the lerna or pkg version I think we'd be okay. The PR lookups would calc a new semver bump and apply that to the version in the current branch.

If we change this to use something outside of the git tree I don't think we'd be able to support that behavior, as there's only ever 1 latest on npm (or wherever we fetch the latest version from)"

~ @adierkens

version:

  • We calculate version using the latest release - could this easily switch to the package version?
  • The latest release on github might be a problem. I don't think you can actually programmatically set the "Latest Release". So when publishing a patch to 1.x it would become the latest release.

release/changelog

  • getCurrentVersion returns lastRelease if gt(lastRelease, lastVersion) - so this would need to be aware of that too

Describe the solution you'd like

We need to depend on latestRelease to be sure that it has a git tag associated with it, so switching isn't an option because we can't be sure that the latest npm version has a tag (like in the thing this issue describes).

I think that we would probably need a new flag that versions from the last git tag. --from-git

With that the release command would probably work. We would have to sort out what the changelog looks like.

the --from-git flag could also override looking at NPM for anything.

Expose API through `main` in package.json

Is your feature request related to a problem? Please describe.

I would like to be able to access auto's API like:

const auto = require('auto-release-cli');

Describe the solution you'd like

Just expose it through the package.json

Describe alternatives you've considered

init script

CLI script to initialize auto in your repository

Custom labels are not respected by the semver checker

Describe the bug

With an autorc like:

{
  "no-version-prefix": true,
  "onlyPublishWithReleaseLabel": true,
  "name": "Artsy",
  "email": "[email protected]",
  "labels": {
    "major": "Version: Major",
    "minor": "Version: Minor",
    "patch": "Version: Patch",
  },
  "noReleaseLabels": ["Version: Trivial", "Skip Release"]
}

Running yarn auto shipit --verbose gives some of the following output:

~/d/p/a/j/s/reaction-force  $ env GH_TOKEN=xxyyzz yarn auto shipit --verbose                                      master
yarn run v1.12.3
$ /Users/ortatherox/dev/projects/artsy/js/sites/reaction-force/node_modules/.bin/auto shipit --verbose
✔  success   Loaded `auto-release` with config: { 'no-version-prefix': true,
  onlyPublishWithReleaseLabel: true,
  name: 'Artsy',
  email: '[email protected]',
  labels:
   { major: 'Version: Major',
     minor: 'Version: Minor',
     patch: 'Version: Patch' },
  noReleaseLabels: [ 'Version: Trivial', 'Skip Release' ] }
✔  success   Using SEMVER labels:
 { major: 'Version: Major',
  minor: 'Version: Minor',
  patch: 'Version: Patch' }
ℹ  info      Getting repo information from package.json

...
but then later
...


ℹ  info      Adding new changes to changelog.
ℹ  info      Getting commits from v9.1.59 to HEAD
ℹ  info      Calculating SEMVER bump using:
 { labels: [ [], [] ],
  versionLabels:
   Map {
     'major' => 'major',
     'minor' => 'minor',
     'patch' => 'patch',
     'skip-release' => 'skip-release',
     'release' => 'release',
     'prerelease' => 'prerelease',
     undefined => undefined },
  options:
   { onlyPublishWithReleaseLabel: false, skipReleaseLabels: [] } }
✔  success   Calculated SEMVER bump: patch
ℹ  info      Calculated next version to be: 9.1.60
ℹ  info      Old changelog exists, prepending changes.

To Reproduce

See this PR: artsy/reaction#1783 which triggered a minor bump: artsy/reaction@d771f62 and started my digging.

I'm happy to take a look into this tomorrow morning, just wanted to make sure it was fully logged etc (but if you have clues, I'd be ++)

Plugin Lookup

Is your feature request related to a problem? Please describe.

There is currently no way to load any plugins

Describe the solution you'd like

CLI/autorc option plugins is an array of string that either:

  • name an included plugin (eg NPM)
  • npm package name
  • filepath

Add Integration Tests

Is your feature request related to a problem? Please describe.

Integration tests would really verify that we aren't breaking anything in the product.

Describe the solution you'd like

Here's my plan:

  1. Need project to represent the multiple states you can start/continue from
    1. fresh package
    2. Fresh monorepo
    3. Already published + tagged package
    4. Already published + tagged monorepo
    5. Project with messed up latest release
  2. Define Fresh Tests
    1. Create Repo
    2. Put simple package in it
    3. Make Pr and merge
    4. Shipit
    5. Ensure GitHub release is correct
    6. Ensure publish to npm
    7. Delete Repo (npm can still be published as we do not check this value. Subsequent test need to check the npm value though so new publishes do not conflict)
  3. Define Published Tests
    1. Make Pr and merge
    2. Shipit
    3. Ensure GitHub release is correct
    4. Ensure publish to npm
  4. Messed Up
    1. Needs an old release tagged as “latest release” on GitHub
    2. Package.json with a newer version than “latest release”
    3. shipit
    4. Ensure GitHub release is correct
    5. Ensure publish to npm

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.