Giter VIP home page Giter VIP logo

flex-development / grease Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6.47 MB

๐Ÿš€ Release workflow tool for Node.js and CLI environments

Home Page: https://github.com/flex-development/grease

License: BSD 3-Clause "New" or "Revised" License

Shell 0.24% JavaScript 9.32% TypeScript 90.35% Ruby 0.09%
bump changelog cli commit commit-analyzer conventional-changelog conventional-commits conventionalcommits git github node nodejs release semver tag typescript version

grease's People

Contributors

dependabot[bot] avatar flex-development[bot] avatar unicornware avatar

Stargazers

 avatar

Watchers

 avatar  avatar

grease's Issues

๐Ÿ‘€ Autodetect options.firstRelease

Describe the ideal solution or feature request

grease should utilize semver utilities to preset IGreaseOptions.firstRelease.

How does this tie into our current product?

This feature would refactor the grease workflow. Before the bump lifecycle, if the package version satisfies 1.0.0 and the option isn't set by the user, options.firstRelease will be set to true. Satisfying versions should include:

  • 1.0.0
  • 1.0.0-<prerelease>, e.g 1.0.0-beta
  • 1.0.0-<prerelease>.<build-number>, e.g 1.0.0-dev.13

Additional context

N/A

Impact, usage, and difficulty

User goals Usage frequency Difficulty scale
ie. What the user wants to accomplish ie. Daily, weekly, monthly, yearly ie. Scale of 1 - 5 (filled out post submission)
set options.firstRelease if final package version satisfies 1.0.0 && argv.firstRelease === undefined daily 1

๐Ÿ› Missing CHANGELOG Entries

Description

All commits for a new project version are not added to its CHANGELOG entry.

Steps to reproduce

  1. Make note of recent commits
  2. Run grease with options.dryRun === true in a project versioned after v1.0.0
  3. See error in changelog lifecycle options.dryRun output

Expected behavior

With respect to options.path, all commits should be able to be found in the CHANGELOG.

Relevant screenshots

Commits that made it into the CHANGELOG interspersed with missing build scope commits

missing-changelog-entries-1

grease output

missing-changelog-entries-2

Environment

Possible solution

Unsure, need to search the standard-version library for possible related issues and debug grease.

Additional context

  • options.path was unset
  • Unsure if the issue is reproducible (may be related to #24)
  • During this particular run, the CHANGELOG entry for @flex-development/[email protected] was missing all build (:hammer: Build) scope commits. Commit entries needed to be manually added

๐Ÿ‘€ย  Autodetect options.prerelease

Describe the ideal solution or feature request

Assuming a project's distribution tag (dist tag) is indicated in its version number (e.g 3.13.98-dev.640 where dev is the intended dist tag), IGreaseOptions.prerelease can be autogenerated.

Although it needs some refactoring, the logic required has actually been implemented in several Flex Development release workflows (even this one!):

  prerelease: ((): string | undefined => {
    const tag = $version.split('-')[1]
    return !tag ? undefined : tag.includes('.') ? tag.split('.')[0] : tag
  })()

How does this tie into our current product?

This feature would remove the need for grease users to set prerelease if their project's dist tag is included in the project version number. To still allow for custom prerelease settings or omitting the option altogether, this feature should be opt-in.

Additional context

  • There have only been internal package downloads thus far, so it would be safe to default prereleaseAuto to true

Impact, usage, and difficulty

User goals Usage frequency Difficulty scale
ie. What the user wants to accomplish ie. Daily, weekly, monthly, yearly ie. Scale of 1 - 5 (filled out post submission)
generate prerelease tag based on package.json#version (opt) daily 1

๐Ÿ› Can't find package version in CHANGELOG during dry runs

Description

If a project version is being bumped after v1.0.0, options.dryRun === true, and release notes are being generated from a project CHANGELOG, the notes lifecycle does not log the generated release notes.

Instead, an Exception is thrown because the new project version hasn't been written to the CHANGELOG, and therefore can not be found within the CHANGELOG content.

Steps to reproduce

  1. Run grease with options.dryRun === true in a project versioned after v1.0.0
  2. See error during notes lifecycle

Expected behavior

The notes lifecycle should not require a version argument if options.dryRun === true.

Relevant screenshots

grease output for @flex-development/[email protected]

notes-lifecycle-dry-run-version-error

Environment

  • Node Version: v16.6.0
  • OS: macOS v11.3.1
  • Package Manager: [email protected]
  • Package version(s): grease<=1.1.0

Possible solution

If possible, the notes lifecycle should tap into standard-version changelog lifecycle to use its options.dryRun output.

The changelog lifecycle could also be re-implemented in grease, but it may be difficult to keep track of future updates to standard-version. If it is re-implemented, however, the lifecycle signature could be updated and the return type could be changed to Promise<string>, where string is the new CHANGELOG entry, Promise<void>:

const Changelog: (
  options?: IGreaseOptions,
  newVersion?: NullishSemanticVersion
) => Promise<NullishString>

The notes lifecycle signature could also be updated:

const Notes: (
  options?: IGreaseOptions,
  changelog?: NullishString,
  version?: NullishSemanticVersion
) => Promise<NullishString>

Additional context

Exception origin in notes lifecycle

  // Search for package version in changelog content
  if (!versions.includes(version)) {
    const data = { errors: { version }, versions }
    const message = `${version} not found in ${options.infile}`

    throw new Exception(ExceptionStatusCode.NOT_FOUND, message, data)
  }

๐Ÿ› CreateReleaseDTO#version failure when options.skip.tag is true

Description

If running the greaser lifecycle and options.skip.tag === true, a ValidationException is thrown because the tag isn't pushed to the current repository. This prevents maintainers from integrating grease with GitHub Action workflows that create release tags.

โ„น starting github release...
โœ– CreateReleaseDTO validation failure: [version]
{
  name: 'BAD_REQUEST',
  message: 'CreateReleaseDTO validation failure: [version]',
  code: 400,
  className: 'bad-request',
  data: {
    target: {
      draft: true,
      files: [ './*.tgz' ],
      notes: '## Overview\n\n\n<!-- Package overview -->\n\n\n## Features\n\n\n\n\n-\n-\n-\n\n\n',
      notesFile: undefined,
      prerelease: false,
      repo: undefined,
      target: 'main',
      title: undefined,
      version: 'v1.0.0'
    }
  },
  errors: [
    {
      value: 'v1.0.0',
      property: 'version',
      children: [],
      constraints: { isSemVer: 'version must be pushed to current git repository' }
    }
  ]
}

Steps to reproduce

  1. Call grease with options.skip.tag set to true
  2. Wait for greaser lifecycle to start
  3. See error

Expected behavior

If options.skip.tag === true, CreateReleaseDTO#version validation should be skipped.

Relevant screenshots

grease@1.0.0-bug

Environment

  • version(s): [email protected]
  • Node / package manager version: Node v16.6.0 / yarn 3.0.1

Possible solution

The ValidateIf logic for CreateReleaseDTO#version should be updated:

  @ValidateIf(() => !$c.options.dryRun && !$c.options.skip?.tag)
  readonly version: ICreateReleaseDTO['version']

Additional context

๐Ÿ› Shell Command Quotes

Description

CreateReleaseDTO#toString does not correctly parse CreateReleaseDTO#notes if it contains inline code strings.

This results in /bin/sh: * errors and the greaser lifecycle interspersing shell errors throughout release notes (see screenshots below).

Steps to reproduce

  1. Create a few commits with code strings (see screenshots below for examples)
  2. Run grease
  3. See /bin/sh: * command not found errors
  4. Go to drafted GitHub release URL to see interspersed shell errors

Expected behavior

CreateReleaseDTO#toString should replace special characters in CreateReleaseDTO#notes when stringifying releases.

Relevant screenshots

greaser lifecycle output for @flex-development/[email protected]

unqouted-shell-commands-1

Release notes interspersed with shell errors

unqouted-shell-commands-2

Commits with code strings

unqouted-shell-commands-3

Environment

  • Node Version: v16.6.0
  • OS: macOS v11.3.1
  • Package Manager: [email protected]
  • Package version(s): grease<=1.1.0

Possible solution

Additional context

  • During this particular run, the CHANGELOG entry for @flex-development/[email protected] was missing all build (:hammer: Build) scope commits. Not sure if this issue is related to this bug, but commit entries needed to be manually added

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.