Skip to content

feat(release): support distribution tags and custom release user info#292

Merged
varl merged 5 commits intonextfrom
dist-tag-support
Mar 15, 2020
Merged

feat(release): support distribution tags and custom release user info#292
varl merged 5 commits intonextfrom
dist-tag-support

Conversation

@varl
Copy link
Copy Markdown
Contributor

@varl varl commented Mar 11, 2020

  • Add some basic docs (incremental improvements...)
  • Move to GitHub Actions
  • Allow releases from branches: master, next, next-major, N.x, N.x.x, N.N.x, beta, alpha
  • Release from branch next publishes on the dist-tag @next, more info here: https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/distribution-channels.md
  • Supports maintenance release patches on branches, e.g. N.x where N is a number. The x is literal, e.g. to release a patch on version 1 create the branch 1.x, for 1.2 create 1.2.x, etc.
  • beta and alpha branches will be marked as prerelease.
  • Allow GIT_* variables to be configured through the environment, previously they were hardcoded.
  • Allow semantic release to read its own configuration file.

@varl varl force-pushed the dist-tag-support branch from 3902e43 to bd3da64 Compare March 11, 2020 09:49
@varl varl force-pushed the dist-tag-support branch from 2dda819 to c17e46b Compare March 11, 2020 11:35
Comment on lines -14 to -15
const fs = require('fs')
const chalk = require('chalk')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused

}) => {
for (const language in translations) {
if (translations.hasOwnProperty(language)) {
if (Object.prototype.hasOwnProperty.call(translations, language)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no access to prototype built-ins

Comment on lines -19 to +20
const filePathToDelete = path.join(inDir, file)
const filePathToDelete = file
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no undefined variables

}

const rest = await tryCatchAsync(
const res = await tryCatchAsync(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused variables

Also a bug where res is accessed later, but the variable is named rest.

await Promise.all(
clusters.map(async cluster => {
const status = await getStatus(cluster)
cluster.status = formatStatus(status)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: possible race condition (mutating source while looping)

}
}

const restoreFromFile = async ({ cacheLocation, dbFile, dbVersion, name }) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused variables

const { reporter, chalk } = require('@dhis2/cli-helpers-engine')

const buildApp = async ({ name, ...argv }) => {
const buildApp = async () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused variables

type = type.toLowerCase()
switch (type) {
case 'cli':
case 'cli': {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: lexical scope needed to use const in case

const command = {
command: 'create <type> [name]',
desc: 'Create various DHIS2 components from templates',
builder: yargs => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused variables

@@ -1,4 +1,4 @@
const run = ({ _, $0, raw, ...argv }) => {
const run = ({ raw, ...argv }) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused variables

const SemanticReleaseError = require('@semantic-release/error')

const analyzeCommits = (config = {}, context) => {
const analyzeCommits = (config, context) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: no unused variables

}

validPackages.forEach(package => {
package.label = package.json.name || '<unnamed>'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: package is a reserved keyword

}

const replaceDependencies = (pkg, listNames, packageNames, version) => {
const replaceDependencies = ({ pkg, listNames, packageNames, version }) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint rule: max-params > 3

@varl
Copy link
Copy Markdown
Contributor Author

varl commented Mar 12, 2020

Added comments to the lint rule resolutions.

@varl varl requested a review from amcgee March 12, 2020 13:41
@amcgee
Copy link
Copy Markdown
Contributor

amcgee commented Mar 12, 2020

@varl this looks great!! (and thanks for fixing all my lint bugs)

I'll take a deeper look at the code, but allowing release to work for non-master branches is clutch :-)

Copy link
Copy Markdown
Contributor

@amcgee amcgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 big win!

@amcgee
Copy link
Copy Markdown
Contributor

amcgee commented Mar 14, 2020

We could merge this to next to test it, but I think this is fine :-D

@varl varl changed the base branch from master to next March 15, 2020 08:19
@varl
Copy link
Copy Markdown
Contributor Author

varl commented Mar 15, 2020

I want to see if it works, so next here we go.

@varl varl merged commit 7e59cf5 into next Mar 15, 2020
@varl varl deleted the dist-tag-support branch March 15, 2020 08:20
dhis2-bot added a commit that referenced this pull request Mar 15, 2020
# [2.9.0](v2.8.1...v2.9.0) (2020-03-15)

### Bug Fixes

* release with the internal changes, not the npm package ([6763800](6763800))

### Features

* **release:** support distribution tags and custom release user info ([#292](#292)) ([7e59cf5](7e59cf5))
@dhis2-bot
Copy link
Copy Markdown
Contributor

varl added a commit that referenced this pull request Mar 15, 2020
…#292)

* feat(release): support distribution tags and custom release user info

* ci(actions): add lint and test

* chore(lint): resolve long-standing lint issues

* ci(actions): update workflow templates

Co-authored-by: Austin McGee <947888+amcgee@users.noreply.github.com>
varl pushed a commit that referenced this pull request Mar 15, 2020
# [2.9.0](v2.8.1...v2.9.0) (2020-03-15)

### Bug Fixes

* release with the internal changes, not the npm package ([6763800](6763800))

### Features

* **release:** support distribution tags and custom release user info ([#292](#292)) ([7e59cf5](7e59cf5))
dhis2-bot added a commit that referenced this pull request Mar 15, 2020
# [2.9.0](v2.8.1...v2.9.0) (2020-03-15)

### Bug Fixes

* release with the internal changes, not the npm package ([2e17226](2e17226))

### Features

* **release:** support distribution tags and custom release user info ([#292](#292)) ([17496d1](17496d1))
dhis2-bot added a commit that referenced this pull request Mar 15, 2020
# [2.9.0](v2.8.1...v2.9.0) (2020-03-15)

### Bug Fixes

* **release:** cannot use squash/rebase when using dist channels in semantic-release ([1f994fb](1f994fb))
* release with the internal changes, not the npm package ([2e17226](2e17226))

### Features

* **release:** support distribution tags and custom release user info ([#292](#292)) ([17496d1](17496d1))
dhis2-bot added a commit that referenced this pull request Mar 15, 2020
# [2.9.0](v2.8.1...v2.9.0) (2020-03-15)

### Bug Fixes

* **release:** cannot use squash/rebase when using dist channels in semantic-release ([1f994fb](1f994fb))
* **release:** fix the changelog ([f6ca488](f6ca488))
* release with the internal changes, not the npm package ([2e17226](2e17226))

### Features

* **release:** support distribution tags and custom release user info ([#292](#292)) ([17496d1](17496d1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants