Giter VIP home page Giter VIP logo

release-toolkit's Introduction

New Relic Experimental header

๐Ÿ› ๏ธ release-toolkit

The release toolkit is a series of small, composable tools that interact together to allow building heavily flexible release pipelines.

The toolkit provides a series of commands, also available as GitHub Actions, that can compose with your existing pipelines to fully automate releases with meaningful, user-facing changelogs.

The way in which the toolkit works is the following:

  1. Maintainers add human-readable changelog entries to the ## Unreleased section in a CHANGELOG.md file.
  2. When the release process is initiated, a pipeline using the toolkit will:
    1. Put the contents of the ## Unreleased section in a machine-readable yaml file, changelog.yaml
    2. Add dependency update entries from Renovate or Dependabot commits
    3. Automatically calculate the next version following semver standards
    4. Generate a Markdown document with the release notes for this release
    5. Reincorporate all the contents of changelog.yaml into CHANGELOG.md, under the correct version header.

Each of these steps is performed as a different step in the pipeline, giving maintainers complete flexibility to skip or add intermediate steps. The machine-readable changelog.yaml can be easily edited with simple scripts, allowing more flexibility to add, remove, or change changelog entries before the steps that act on them take place.

Sneak peek

A pipeline using the release toolkit could look like the following:

name: Release workflow
on:
   workflow-dispatch:
jobs:
  - uses: actions/checkout@v3
  - name: Generate transient changelog.yaml
    uses: newrelic/release-toolkit/generate-yaml@v1
    with:
       excluded-dirs: .github
    # changelog.yaml is a temporary, machine-readable file containing unreleased changes.
    # - Entries from your CHANGELOG.md's Unreleased section.
    # - Entries generated from bot commits (e.g. dependabot/renovate)
  # - name: You can hack changelog.yaml!
  #   run: |
  #     yq ...
  #     custom-script.sh ...
  - name: Figure out next version automatically
    id: next-version
    uses: newrelic/release-toolkit/next-version@v1
  - name: Generate release notes
    uses: newrelic/release-toolkit/render@v1
    # CHANGELOG.partial.md now contains release notes for this version.
  - name: Update CHANGELOG.md
    uses: newrelic/release-toolkit/update-markdown@v1
    with:
      next-version: ${{ steps.next-version.outputs.version }}
    # CHANGELOG.md is now updated with the contents of changelog.yaml, in MD format.
  - name: Commit and tag release
    run: |
      VERSION="${{ steps.next-version.outputs.next-version }}"
      git add CHANGELOG.md
      git commit -m "release $VERSION"
      git push
      gh release create $VERSION -F CHANGELOG.partial.md
  - name: Build and publish artifacts
    run: |
      docker build . -t example:${{ steps.next-version.outputs.next-version }}
      docker push example:${{ steps.next-version.outputs.next-version }}

generate-changelog and changelog.yaml

generate-yaml action diagram

The heart of the release toolkit architecture is the changelog.yaml file. This file is transient (i.e. it is not committed into the repository), and is typically generated by the generate-yaml action as a first step in a release pipeline. Subsequent steps will look at this file as the source of truth.

generate-changelog will populate changelog.yaml with:

  • Changelog entries written by maintainers in the ## Unreleased section of CHANGELOG.md. Typically, these entries will be added in the same PR the mentioned changes are.
  • Dependabot commits that happened after the last release.
  • Renovate commits that happened after the last release.

The changelog object represented in this YAML file has 3 important fields:

  • changes: List of changes parsed from CHANGELOG.md Changes have a type and a message, and changes belonging to the same type are grouped in the release notes.
  • dependencies: List of dependencies that have been updated in this release. Entries optionally include from and to which version the dependency has been updates.
  • notes: This is a free-text field that is included in the release notes before the list of changes. It can be used to add context to some changes, point users to documentations, or anything at all. Markdown syntax is allowed.

A freshly-generated changelog.yaml file looks like this:

notes: |-
  ### Important announcement (note)
  This is a release note
changes:
  - type: breaking
    message: Support has been removed
  - type: security
    message: Fixed a security issue
  - type: enhancement
    message: New feature has been added
dependencies:
  - name: docker/setup-buildx-action
    from: "1.0.0"
    to: "2.0.0"
    meta:
      pr: "100"
      commit: a72b98709dfa0d28cf7c73020f3dede670f7a37f

In addition to the fields listed above, there's a fourth boolean field called held. Purpose and behavior of this field is explained in the advanced section of this manual.

This generate-yaml command will extract this changes and notes from 3 different sources:

render-markdown and update-markdown

generate-yaml action diagram

As a part of the release process, contents of the ## Unreleased section in CHANGELOG.md need to be moved under a header with the name of the version being released. This is done by render-markdown, which loads a changelog.yaml file and pretty-prints it in Markdown format, grouping changes under headers depending on their type.

The list of entry types, and therefore groups, supported by the release-toolkit are:

  • breaking: A breaking change on a user-facing API. Rendered first and with a warning sign to quickly catch the attention of the reader.
  • security: Security fixes that remediate potential or existing security vulnerabilities.
  • enhancement: New features or improvements to existing ones.
  • bugfix: Fixes to incorrect behavior of the application.

Additionally, a section with changes to dependencies is also included after the list of changes.

Notice that the list of dependencies is deduplicated in case the very same dependency is updated more than once. Merely the latest bump per each dependency is shown in order to simplify the changelog.

The Markdown version of the changelog.yaml file mentioned above would be:

## v1.2.3 - 2022-10-11

### Important announcement (note)

This is a release note

### โš ๏ธ๏ธ Breaking changes โš ๏ธ
- Support has been removed

### ๐Ÿ›ก๏ธ Security notices
- Fixed a security issue

### ๐Ÿš€ Enhancements
- New feature has been added

### โ›“๏ธ Dependencies
- Upgraded docker/setup-buildx-action from 1.0.0 to 2.0.0 (#100)

Complementary to render-markdown, update-markdown will merge the markdown version of changelog.yaml into the CHANGELOG.md file, generating a new version header with the changes. In this process, it also will empty the contents of the ## Unreleased section.

next-version

generate-yaml action diagram

An important part of being able to automatically release is relieving maintainers from manually figuring out what would need the next version number be. This not only allows for fully automation of the process while respecting Semantic Versioning standards, it also ensures that said standards are preserved, avoiding Sentimental Versioning.

The next version number is computed by fetching the last existing tag on the repository, and bumping the appropriate number according to the highest impact change type listed in changelog.yaml.

The mapping between change types and bump types is as follows:

breaking    => Major
security    => Minor
enhancement => Minor
bugfix      => Patch

Dependency bumps will propagate the bump made to the library: Bumping the major version of a dependency will bump the major version of the program. As this may be an undesired effect, it is possible to "cap" the largest bump that dependencies can cause.

next-version will return an error if it cannot find a previous version to bump. This is done to surface potentially unintended changes in the configuration of the command that causes it to stop reading existing versions.

Additional features

link-dependencies

link-dependencies can be used to attach a link to the changelog of the bumped dependency for each dependency in the dependencies array.

To compute this link there the release toolkit tries to map the link executing this two tasks executed in the following order:

Dictionary file

A dictionary is a YAML file with a root dictionary object, which contains a map from dependency names to a template that will be rendered into a URL pointing to its changelog. The template link must be in Go tpl format and typically will include the {{.To.Original}} variable that will be replaced by the last bumped version.

Example dictionary file:

dictionary:
  a-dependency: "https://github.com/my-org/a-dependency/releases/tag/{{.To.Original}}"

changelog.yaml before linking dependencies:

dependencies:
  - name: a-dependency
    from: "2.1.0"
    to: "3.0.0"

changelog.yaml after linking dependencies:

dependencies:
  - name: a-dependency
    from: "2.1.0"
    to: "3.0.0"
    meta:
      changelog: https://github.com/my-org/a-dependency/releases/tag/3.0.0

Automatically detected GitHub repository

When the dependency does not match any entry in the dictionary file, but it does match GitHub repositories (github.com/<org>/<repo>), the changelog link is automatically rendered using https://github.com/<org>/<repo>/releases/tag/<new-version>.

After rendering, the release toolkit checks if the changelog link is valid by performing a HTTP request, so only valid changelog links are used. As some repositories include a leading v in the tag name identifying the release and some others don't, both possible links are checked. This validation can be disabled using the disable-github-validation flag.

Automated releasing

The ultimate goal of the release toolkit is to allow for fully automated release pipelines that produce meaningful changelogs and respect semver standards. For this reason, the recommended way of implementing the toolkit is as a scheduled job that runs on the main/master branch of your source tree, for example every tuesday at midnight.

The release toolkit allows you to build a pipeline that creates a release with its changelog and version automatically if there are any unreleased changes in your main branch.

However, it is possible that, in some cases, you may want to hold changes from being released as you want to "pack" them with future changes for UX reasons. To this end, the release toolkit includes the concept of holding releases. A release can be held by including a ## Held L2 header in CHANGELOG.md. This header must be followed by a paragraph explaining why automated releases are on hold:

# Changelog
This is based on blah blah blah

## Held

Holding release as it contains massive breaking changes

## Unreleased

### Breaking
- Support has been removed

## v1.2.3 - 20YY-DD-MM

The presence of this header does not modify the fundamental behavior of any command. It does, however, cause generate-changelog to include a held: true property in changelog.yaml:

held: true
changes:
  - type: breaking
    message: Support has been removed

This flag can be readily checked using the is-held action/command. is-held will echo the value of this property to stdout, and can be configured to exit with non-zero if held is set to true. While running as an action, it will also set the is-held step output to the value of the property. This allows your pipeline to react to this property and skip the release process if a ## Held entry is present in your CHANGELOG.md.

update-changelog will not behave any different in presence of a ## Held header, and will remove it before integrating the changelog for the latest release.

Full example of automated releasing pipeline

release-toolkit.png

// TODO

Actions

Contributing

Standard policy and procedure across the New Relic GitHub organization.

Useful Links

Support

New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.

We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.

License

release-toolkit is licensed under the Apache 2.0 License.

Disclaimer

This tool is provided by New Relic AS IS, without warranty of any kind. New Relic does not guarantee that the tool will: not cause any disruption to services or systems; provide results that are complete or 100% accurate; correct or cure any detected vulnerability; or provide specific remediation advice.

release-toolkit's People

Contributors

alvarocabanas avatar cliftondobrich avatar davidgit avatar dependabot[bot] avatar gsanchezgavier avatar kang-makes avatar marcsanmi avatar paologallinaharbur avatar roobre avatar sigilioso avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

release-toolkit's Issues

changelog.md old entries are dump if version has `[]`

An existing changelog like

Changelog

All notable changes are documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

Unreleased

[0.0.1] - 2022-09-20

Added

  • First Version of newrelic-prometheus-configurator.

will be removed if a new version is generated with update-changlog

I noticed that removing the brackets [] fixes the issue

Make the dictionary mapper the first in stack

  • We should modify the order of the mappers so, when dictionary file is present, it's the first to be executed.
  • It also makes sense to have default value for dictionary .github/workflows/dictionary.yaml

`next-version` should error if there is no previous version

During discussions in #110, we decided that it should be okay for next-version to return something, namely v0.0.1, if there are no previous versions in the repo. This is useful so a pipeline built on top of the release toolkit can bootstrap a repo from scratch.

However, I think we should revisit this. Let us consider the following case:

  • I have a repository with several versions in, and current version is v1.2.3
  • I make some changes to the pipeline using rt, and I mistakenly add (or change) the --tag-prefix myproject argument/input to the rt actions
  • The release toolkit happily accepts this

On my next release, something bad will happen: next-version will see that there are no previous tags matching the prefix, and will return v0.0.1. My next release will mistakenly be v0.0.1, and I won't realize until the release is done.

I think we should prevent this footgun by default.

Suggestion

  • Make a small change so next-version errors by default with a helpful message if no previous versions are found.
  • Add a flag to next-version, e.g. --first, false by default, that will cause next-version to return v0.0.1 if there are no previous versions (current behavior).

Eager to hear your thoughts on this :)

renovate: parse table in commit body for batch updates

Renovate can be configured to batch PRs. In this case, the commit line will not contain all the individual dependencies. Instead, renovate includes a table with all the bumped dependencies

Example pr: https://togithub.com/newrelic/helm-charts/pull/930

Example table:

| Package | Update | Change |
|---|---|---|
| [newrelic-infra-operator](https://hub.docker.com/r/newrelic/newrelic-infra-operator) ([source](https://togithub.com/newrelic/newrelic-infra-operator)) | patch | `1.0.7` -> `1.0.8` |
| [newrelic-infrastructure](https://docs.newrelic.com/docs/kubernetes-pixie/kubernetes-integration/get-started/introduction-kubernetes-integration/) ([source](https://togithub.com/newrelic/nri-kubernetes)) | patch | `3.8.3` -> `3.8.8` |
| [newrelic-k8s-metrics-adapter](https://hub.docker.com/r/newrelic/newrelic-k8s-metrics-adapter) ([source](https://togithub.com/newrelic/newrelic-k8s-metrics-adapter)) | patch | `0.7.8` -> `0.7.11` |
| [nri-kube-events](https://docs.newrelic.com/docs/integrations/kubernetes-integration/kubernetes-events/install-kubernetes-events-integration) ([source](https://togithub.com/newrelic/nri-kube-events)) | patch | `2.2.7` -> `2.2.8` |
| [nri-metadata-injection](https://hub.docker.com/r/newrelic/k8s-metadata-injection) ([source](https://togithub.com/newrelic/k8s-metadata-injection)) | patch | `3.0.7` -> `3.0.8` |
| [nri-prometheus](https://docs.newrelic.com/docs/infrastructure/prometheus-integrations/install-configure-openmetrics/configure-prometheus-openmetrics-integrations/) ([source](https://togithub.com/newrelic/nri-prometheus)) | patch | `2.1.11` -> `2.1.13` |

This could be easily parsable using a regex.

`validate` passes even for invalid unreleased messages

if I added an invalid unrelease comment , the generate changelog will not take it into account but the validate will out TRUE

example:

# Changelog
All notable changes are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

this INVALID comment will be removed from the final changelog but the validate still will output TRUE

### This will be valid
- my valid comment

## 0.0.1 - 2022-09-20
### Added
- First Version of `newrelic-prometheus-configurator`.

Output from generate:

# Changelog
All notable changes are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## v0.0.2 - 2022-10-03

### This will be valid
- my valid comment

### โ›“๏ธ Dependencies
- Updated dependencies

## 0.0.1 - 2022-09-20
### Added
- First Version of `newrelic-prometheus-configurator`.

`CommitsGetter` should return an error if `lastHash` is not found within the tree

Currently, if we call RepoCommitsGetter.Commits with a value for lastHash that is not found while iterating the history, all commits are returned. This can be problematic if we supply a value for lastHash that is made up, or more likely, a hash from a commit that no longer exists or is not part of the history of the main branch. With the current behavior, we would return a changelog since the beginning of times.

To prevent this, Commits should return an error if lastHash is not found altogether.

Format message content

It is not easy to format the message content:

Both the following fails

 - Defaults of the charts have been changed:
Now, the chart has two jobs configured and curated experience turned on by default:
   - `default` scrapes all targets having `prometheus.io/scrape: true`.
   Since, by default, curated_experience.enabled=true then only targets selected by the curated experience are actually scraped.
   - `newrelic` crapes all targets having `newrelic.io/scrape: true`.
   This is useful to extend the 'default-job' allowlisting all services adding the required annotation.

Result -> WARN[0001] ListItem has more than 1 children WARN[0001] No list items found under header "Enhancements"

 - Defaults of the charts have been changed:
Now, the chart has two jobs configured and curated experience turned on by default:
  
  `default` scrapes all targets having `prometheus.io/scrape: true`.
   Since, by default, curated_experience.enabled=true then only targets selected by the curated experience are actually scraped.
   
   `newrelic` crapes all targets having `newrelic.io/scrape: true`.
   This is useful to extend the 'default-job' allowlisting all services adding the required annotation.

The result is without the description-> Defaults of the charts have been changed: Now, the chart has two jobs configured and curated experience turned on by default:

update-changelog: code

Given an existing CHANGELOG.md file, and a changelog.yaml file, we need an object that takes both and merges them.

`TestRepoTagsSource_LastVersionHash/Matching_And_Replacing_Prefix` should not be passing

This test should not be passing:

{
name: "Matching_And_Replacing_Prefix",
tagOpts: []git.TagOptionFunc{
git.TagsMatching("^helm-chart-"),
},
tagSourceOpts: []git.TagSourceOptionFunc{
git.TagSourceReplacing("helm-chart-", ""),
},
expectedHash: getVersionCommitHash(
t,
repodir,
"helm-chart-1.3.0",
git.TagsMatching("^helm-chart-"),
),
},
} {

The latest tag matching this criteria is helm-chart-1.3.1, not helm-chart-1.3.0

testCommitTag{"helm-chart-1.3.0", []string{"helm-chart-1.3.0"}},
testCommitTag{"helm-chart-1.3.1", []string{"helm-chart-1.3.1"}},

renderer: short dependency names

Dependencies from dependabot might have large names, such as github.com/golangci/golangci-lint.

It might be good to add a toggle to the renderer that shortens this names down, e.g. to just golangci-lint.

Revisit commandline argument names and their action equivalents

More specifically:

  • --changelog is ambiguous. Does it refer to the YAML changelog or the MD changelog?
  • --md Is not very explanatory, markdown what?
  • --dir Is not explanatory either

Initial proposal:

  • --changelog โžก๏ธ --yaml
  • --md โžก๏ธ --markdown
  • --dir โžก๏ธ --git-root

Add a link-changelog command/action

For packages that mostly wrap other packages, e.g. the nri-bundle helm chart, the ability to link to a dependency changelog would be very desirable. For example:


v1.2.3 - 2022-08-25

Dependencies

  • Upgraded newrelic-infrastructure chart to v3.2.1 (See changes)

This could be tricky and might need some heuristics to work, specially if we don't have the full dependency name. In the worst case scenario, we might need to ask users for a dictionary from dependency names to changelog URLs, e.g. something like

dependencyChangelogs:
  newrelic-infrastructure: "https://github.com/newrelic/nri-kubernetes/releases/tag/newrelic-infrastructure-%s"
  infrastructure-agent: "https://github.com/newrelic/infrastructure-agent/releases/tag/%s"

If we have full dependency names, e.g. github.com/newrelic/nri-kubernetes instead of nri-kubernetes, we might not need this.

default `-markdown` file not working on `rt update-changelog`

Default value should be CHANGELOG.md according to cli docs but that is not being honored

โžœ  newrelic-prometheus git:(ci-toolkit-manual-image) โœ— rt update-changelog
NAME:
   rt update-changelog - Incorporates a changelog.yaml into a complete CHANGELOG.md.

USAGE:
   rt update-changelog [command options] [arguments...]

OPTIONS:
   --date value      Date to stamp in the changelog section header, in YYYY-MM-DD format. If empty it will default to the current time (time.Now()). (default: 2022-10-03 15:37:01.940194 +0200 CEST m=+0.001032751) [$DATE]
   --markdown value  Path to the destination markdown file. (default: "CHANGELOG.md") [$MARKDOWN]
   --version value   Version to stamp in the changelog section header. If omitted, no version header will be generated. [$VERSION]

FATA[0000] Required flag "markdown" not set
โžœ  newrelic-prometheus git:(ci-toolkit-manual-image) โœ—

Add file include/exclude options for commit-based sources

Currently, commit-based sources (i.e. Renovate and Dependabot) generate changelog entries regardless of where the change has been made. This can be a problem for monorepos, e.g. an application and its helm chart.

A way to work around this could be to add arguments to ignore commits that include or exclude certain files.

For example:

rt generate-changelog --renovate-exclude charts/

This option would get passed to the renovate source, that will ignore any commit impacting files in charts/

It would also be good to have the complementary option:

rt generate-changelog --renovate-include charts/

Which would tell the renovate source to only consider commits impacting files inside charts/

Implementation notes

  • Glob pattern matching should be preferred instead of regexes
  • Including/excluding a folder should include/exclude (respectively) any file or folder placed under it. E.g. charts/ should match charts/foo/bar, but not charts-new
  • A good initial approach would be to implement a commit filterer, which can wrap a CommitsGetter implementation and also implement the same interface. This way it could be reused by both renovate and dependabot sources.
    • We will likely need to add a list of changed files to git.Commit for that to work.

action: build docker images in advance

Current implementation (#49) uses action of type Docker, and builds said container image on each action invocation. This has some upsides:

  • It is simple, as we don't need to care about uploading a pre-built image anywhere
  • Image is always up to date with the action ref, as it is built from it
    But it also has significant downturns, namely:
  • It is slow as go modules have to be downloaded and the program needs to be built each time

We could consider building images e.g. on release, which should provide a significant runtime speed-up. However, that needs to be done with care such as the tag referenced by action.yml matches the version of action.yml itself.

helm: add a chart-changelog action

It would be great to have a dead-simple action that integrates a generated changelog.yml file into a helm chart changelog annotation, as defined by ArtifactHub.

Ideally, this command should not alter the rest of the Chart.yaml file, meaning it should preserve both comments and the order of entries in the file. Go YAML v3 can do this if you unmarshal entries into a yaml.Node struct, but we can consider other approaches as well.

`link-changelog` is removing commit metadata

to reproduce:

rt generate --excluded-dirs "charts,.github" --tag-prefix "v"

Generated changelog.yaml

notes: ""
changes: []
dependencies:
    - name: dependencies
      meta:
        pr: "105"
        commit: 8996fddbe59275f9103ceac77dfcd3ed391a6f92

then execute rt link-changelog

notes: ""
changes: []
dependencies:
    - name: dependencies

NOTE: this commit is not from a bot. but looks like is computed as a dependabot since if I do

rt generate --excluded-dirs "charts,.github" --tag-prefix "v" --dependabot=false

the commit is not listed.

This is the actual commit. And I'm generating the release from this commit

next-tag: cmd

Add an urfave/cli command that takes a changelog.yaml file path as an input, as well as a tag.Source, and uses the Bumper object to output the next tag to stdout

extract-changelog: renovate commits

We want a changelog.Source that builds a changelog.Changelog from commits as done by renovatebot.

This source will need to:

  1. Parse commits in the said format, returning at least the name of the dependency name being bumped
  2. Consider only commits after the latest (ordered by semver, not date) tag in the repo

validate-changelog: code

We have a Markdown changelog parser, and we want an action to return non-zero if the parser cannot parse a given file.

Changelog format is heavily inspired by https://keepachangelog.com/en/1.0.0/, and should conform to the following rules:

  • Has exactly one L1 header with the exact, case-sensitive check Changelog
  • Must have an L2 header named Unreleased, which may be empty
  • May have an L2 header named Held, which if exists, must not be empty
  • All other L2 headers must contain a version and a date ^v\d+.\d+.\d+. - \d+-\d+-\d+$, which we call "version headers"
  • L2 version headers must not be empty
  • L3 headers must not be empty
  • L3 headers that match one of the defined changelog.EntryType must contain only an itemized list

next-tag: version source

We need to provide a way to check which is the current version of the code so we can calculate the next version. There should be a Source interface to provide the version in two different ways:

  1. From the latest semver tag of the repo
  2. Provided by the user

Github mapper incorrect link when leading v

We have detected that certain dependencies that have releases with leading "v" in the version, when reported by dependabot, the commit message strips the v as following:

  • chore(deps): bump github.com/spf13/viper from 1.7.0 to 1.10.1

When the Github mapper generates the changelog link, it doesn't work because it should be in the format:

  • https://github.com/spf13/viper/releases/tag/v1.10.1

One option we can do is add a step in the mapper that curls the url with and without the leading v and save the one that gets a 200.

Add `--excluded-dirs=.github` by default in all examples

One of the premises that leaded to this toolkit being born was that changes on non user-facing parts of a repository, such as build system, should not result in a new user-facing release.

However, as of now dependency bumps of github actions will result in a new release. An easy way to prevent this is to add the .github to excluded-dirs in generate-yaml.

Doing this by default is very tricky, so allegedly the best way to do so is to put it on every example we write.

extract-changelog: dependabot commits

We want a changelog.Source that builds a changelog.Changelog from commits as done by dependabot.

This source will need to:

  1. Parse commits in the said format, returning at least the name of the dependency name being bumped
  2. Consider only commits after the latest (ordered by semver, not date) tag in the repo

Test

Description

A clear and concise description of the feature you want or need

Acceptance Criteria

What tasks need to be accomplished to achieve the goal?

Describe Alternatives

A clear and concise description of any alternative solutions or features you've considered
Are there examples you could link us to?

Dependencies

Do any other teams or parts of the New Relic product need to be considered?
Some common areas: UI, collector, documentation

Additional context

What else should we know about this story that might not fit into the other categories?

Estimates

Please provide initial t-shirt size. S = 1-3 days, M = 3-5 days (1 week), L = 1-2 weeks (1 sprint)

For Maintainers Only or Hero Triaging this bug

Suggested Priority (P1,P2,P3,P4,P5):
Suggested T-Shirt size (S, M, L, XL, Unknown):

Inconsistent CHANGELOG link generation for dependency versions

The release toolkit isn't generating correct CHANGELOG links for dependencies in some cases. Examples of this can be seen in:

The issue arises because the link is generated by appending the version number without the preceding v. This approach isn't consistent for the integrations, but it does work for the infrastructure agent where releases are created without the leading v. For instance:

We need to think of a solution that works in both formats.

Related: newrelic/nri-ecs#139

Panic due to extra spaces

This works

## Unreleased

### Bugfix
- `imagePullPolicy` is now correctly applied to the init container as well.

The same with extra spaces causes a panic:

## Unreleased

### Bugfix
- `imagePullPolicy` is now correctly applied to the init container as well.    <--this are extra spaces

Trace ๐Ÿ˜ฑ

panic: node *ast.Hardbreak NYI

goroutine 1 [running]:
github.com/gomarkdown/markdown/md.(*Renderer).RenderNode(0x100f9c108?, {0x1009c4160?, 0x14000092690?}, {0x1009ca698?, 0x140003fc960?}, 0x60?)
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/md/md_renderer.go:293 +0xa30
github.com/gomarkdown/markdown.Render.func1({0x1009ca698?, 0x140003fc960?}, 0xf8?)
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/markdown.go:63 +0x50
github.com/gomarkdown/markdown/ast.NodeVisitorFunc.Visit(0x140005e4240?, {0x1009ca698?, 0x140003fc960?}, 0x58?)
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:563 +0x38
github.com/gomarkdown/markdown/ast.Walk({0x1009ca698, 0x140003fc960}, {0x1009c57c0, 0x14000076340})
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:535 +0x58
github.com/gomarkdown/markdown/ast.Walk({0x1009ca9b0, 0x140005e4240}, {0x1009c57c0, 0x14000076340})
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:546 +0x140
github.com/gomarkdown/markdown/ast.WalkFunc(...)
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:569
github.com/gomarkdown/markdown.Render({0x1009ca9b0, 0x140005e4240}, {0x1009c7ef8, 0x1400062c300})
        /Users/pgallina/go/pkg/mod/github.com/gomarkdown/[email protected]/markdown.go:62 +0xd8
github.com/newrelic/release-toolkit/src/changelog/sources/markdown.items({0x140000761d0?, 0x1, 0x10080a576?})
        /Users/pgallina/go/pkg/mod/github.com/newrelic/[email protected]/src/changelog/sources/markdown/md.go:164 +0x28c
github.com/newrelic/release-toolkit/src/changelog/sources/markdown.builder.entriesFromHeader({0x140003fdb80?, 0x140004683c0?, 0x140000925a0?}, 0x140003fdc20, {0x1007f0c4f, 0x6})
        /Users/pgallina/go/pkg/mod/github.com/newrelic/[email protected]/src/changelog/sources/markdown/md.go:110 +0xec
github.com/newrelic/release-toolkit/src/changelog/sources/markdown.builder.build({0x140003fdb80, 0x0?, 0x0?})
        /Users/pgallina/go/pkg/mod/github.com/newrelic/[email protected]/src/changelog/sources/markdown/md.go:82 +0x384
github.com/newrelic/release-toolkit/src/changelog/sources/markdown.Markdown.Changelog({{0x1009c50a0?, 0x14000554378?}})
        /Users/pgallina/go/pkg/mod/github.com/newrelic/[email protected]/src/changelog/sources/markdown/md.go:50 +0x7c
github.com/newrelic/release-toolkit/src/app/generate.Generate(0x140001e4940)
        /Users/pgallina/go/pkg/mod/github.com/newrelic/[email protected]/src/app/generate/generate.go:151 +0x46c
github.com/urfave/cli/v2.(*Command).Run(0x100cec900, 0x140001e4640)
        /Users/pgallina/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:173 +0x5ac
github.com/urfave/cli/v2.(*App).RunContext(0x140001a2540, {0x1009c8e10?, 0x140000280d0}, {0x14000020080, 0x8, 0x8})
        /Users/pgallina/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:383 +0xb90
github.com/urfave/cli/v2.(*App).Run(...)
        /Users/pgallina/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252
main.main()
        /Users/pgallina/go/pkg/mod/github.com/newrelic/[email protected]/main.go:11 +0x48
exit status 2
make: *** [_release-changes-chart] Error 1

Changelog leveraging release-toolkit itself

It would be nice to have in this repo an action dealing with releases.

The main purpose would be to maintain the changelog and to provide an example regarding how to use the actions (similarly to what we did for the e2e action).

actions: common structure

We will need the common structure to run the urfave/cli commands as github actions.

Ideally these actions should be of type: docker, but for the first iteration we can use type: composite if the former is more complicated.

[contrib/ohi-release-notes] static reference @v1

The current implementation in contrib/ohi-release-notes/action.yml is not the best since it makes modifying and testing the action difficult.

    - name: Generate YAML
      uses: newrelic/release-toolkit/generate-yaml@v1

Moreover, whenever we trigger the action using a tag different from V1 (with a feature branch or a different tag) we would expect the subaction to be called with the very same tag

Check here for more context

Body in notes not respecting new line

The following Notes content in the unreleased section:

### Note
a note content
more content

### Second note
content

Produces the following:

### Note
a note content more content
### Second note
content

This is because of how the library works, following Vanilla Markdown. We may think if we like the result and leave it as it is or if we want to create a wrapper or something to modify this behavior.

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.