Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate changelog #4743

Merged
merged 52 commits into from Mar 8, 2022
Merged

Automate changelog #4743

merged 52 commits into from Mar 8, 2022

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Feb 17, 2022

resolves #4652

Description

This adds changie to dbt-core!

  • New directory .changes where the actual changelog files (yaml or md) will live. This directory also contains a header file that will apply as a header to the entire CHANGELOG.md
  • .changie.yaml defines what data is in a changelog entry as well as the format it will output into markdown.
  • Added relevant updates to CONTRIBUTING
  • New GitHub action to block merging if no new changelog file has been generated. The best this can do is check the PR has a new .yaml in the appropriate directory as the file names are generated dynamically. It also provides an override where the Skip Changelog label on a PR would allow the check to pass without the file.

Pending

  • Before merging into main, make sure the markdown file in /.changes is up to date for the most recent version of the master changelog.
  • GHA to generate and merge in the changelog. For the first run it may be useful to do it manually just to make sure everything gets synced up with the right dates, etc in the "legacy" CHANGELOG. After the first time it should all be automated without issue. [CT-289] Automate Changelog Generation on Release #4789

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change

@cla-bot cla-bot bot added the cla:yes label Feb 17, 2022
.changes/header.tpl.md Outdated Show resolved Hide resolved
@emmyoop
Copy link
Member Author

emmyoop commented Feb 22, 2022

New changie release for the pre-release request. Need to look into how it works but will hopefully replace the manual script I wrote!

Edit: This release 100% replaced my last custom script!

@github-actions
Copy link
Contributor

👋 Thanks for adding a changelog entry!

@github-actions
Copy link
Contributor

👋 Thanks for adding a changelog entry! Delete this before the end. It's really just here to test output.

1 similar comment
@github-actions
Copy link
Contributor

👋 Thanks for adding a changelog entry! Delete this before the end. It's really just here to test output.

@emmyoop emmyoop marked this pull request as ready for review February 24, 2022 21:51
@emmyoop emmyoop requested a review from a team as a code owner February 24, 2022 21:51
Copy link
Contributor

@iknox-fa iknox-fa left a comment

Choose a reason for hiding this comment

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

This looks great! I'm on the fence about this, but should we include changie as part of the Makefile? I opted to add it for pre-commit, but this feels somewhere inbetween a developer's choice thing and a required thing.

Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

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

I am sooooo looking forward to this!

.changes/README.md Outdated Show resolved Hide resolved
.changes/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@nathaniel-may nathaniel-may left a comment

Choose a reason for hiding this comment

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

I didn't take a close enough look at the action and the templates yet but I wanted to leave the note about make dev.

### Workflow

#### Daily workflow
Each code change gets a changlog file by running `changie new` and following the prompts. This ensures correct file format and file name.
Copy link
Contributor

Choose a reason for hiding this comment

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

to run changie new should we add it to be installed with make dev?


We use [changie](https://changie.dev) to generate `CHANGELOG` entries. Do not edit the `CHANGELOG.md` directly. Your modifications will be lost.

Follow the steps to [install `changie`](https://changie.dev/guide/installation/) for your system.
Copy link
Contributor

Choose a reason for hiding this comment

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

if we use make dev this instruction could change to reflect that.

Copy link
Member Author

Choose a reason for hiding this comment

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

To close the loop from a slack conversation, we can't add changie to make dev as it isn't available through pip. If this becomes an issue we'll explore some alternative ways to make changie available.

Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

This is great!!! One question, what will happen to the original changelog?

@emmyoop
Copy link
Member Author

emmyoop commented Feb 25, 2022

@ChenyuLInx The original changelog is saved as a markdown file in /.changes here. When ready to merge this in I was going to update the name to whatever release is the most recent.

Every time changie merge is run it stitches together all the markdown files in /.changes to generate the CHANGELOG.

footerFormat: |
Contributors:
{{- $contributorDict := dict }}
{{- $core_team := list "emmyoop" "nathaniel-may" "gshank" "leahwicz" "ChenyuLInx" "stu-k" "iknox-fa" "VersusFacit" "McKnight-42" "jtcohen6" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a good first issue for new hires to just add themselves to this list

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a single running list of things like this somewhere?

I don't like that this is hardcoded but I'm not seeing a way around it at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we can use GitHub's team concept to get this list. We have the Core team which contains all the handles. For this PR, I'm ok with the hardcoded list but then thinking about improvements after that

Copy link
Contributor

Choose a reason for hiding this comment

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

The Github API looks like it has a way to do it via the returned "login" field, but it would involve mapping over the returned list. I agree it would be good for a subsequent improvement.

.changes/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@leahwicz leahwicz left a comment

Choose a reason for hiding this comment

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

LGTM!

@emmyoop emmyoop force-pushed the er/ct-115-automate-changelog branch from 5660596 to 1f39de2 Compare March 8, 2022 01:48
@emmyoop emmyoop merged commit 9a0abc1 into main Mar 8, 2022
@emmyoop emmyoop deleted the er/ct-115-automate-changelog branch March 8, 2022 02:12
emmyoop added a commit that referenced this pull request Mar 8, 2022
* initial setup to use changie

* added `dbt-core` to version line

* fix formatting

* rename to be more accurate

* remove extra file

* add stug for contributing section

* updated docs for contributing and changelog

* first pass at changelog check

* Fix workflow name

* comment on handling failure

* add automatic contributors section via footer

* removed unused initialization

* add script to automate entire changelog creation and handle prereleases

* stub out README

* add changelog entry!

* no longer need to add contributors ourselves

* fixed formatted and excluded core team

* fix typo and collapse if statement

* updated to reflect automatic pre-release handling

Removed custom script in favor of built in pre-release functionality in new version of changie.

* update contributing doc

* pass at GHA

* fix path

* all changed files

* more GHA work

* continued GHA work

* try another approach

* testing

* adding comment via GHA

* added uses for GHA

* more debugging

* fixed formatting

* another comment attempt

* remove read permission

* add label check

* fix quotes

* checking label logic

* test forcing failure

* remove extra script tag

* removed logic for having changelog

* Revert "removed logic for having changelog"

This reverts commit 490bda8.

* remove unused workflow section

* update header and readme

* update with current version of changelog

* add step failure for missing changelog file

* fix typos and formatting

* small tweaks per feedback

* Update so changelog end up onlywith current version, not past

* update changelog to recent contents

* added the rest of our releases to previous release list

* clarifying the readme

* updated to reflect current changelog state

* updated so only 1.1 changes are on main
# Conflicts:
#	CHANGELOG.md
@emmyoop emmyoop mentioned this pull request Mar 8, 2022
4 tasks
emmyoop added a commit that referenced this pull request Mar 9, 2022
* Automate changelog (#4743)

* initial setup to use changie

* added `dbt-core` to version line

* fix formatting

* rename to be more accurate

* remove extra file

* add stug for contributing section

* updated docs for contributing and changelog

* first pass at changelog check

* Fix workflow name

* comment on handling failure

* add automatic contributors section via footer

* removed unused initialization

* add script to automate entire changelog creation and handle prereleases

* stub out README

* add changelog entry!

* no longer need to add contributors ourselves

* fixed formatted and excluded core team

* fix typo and collapse if statement

* updated to reflect automatic pre-release handling

Removed custom script in favor of built in pre-release functionality in new version of changie.

* update contributing doc

* pass at GHA

* fix path

* all changed files

* more GHA work

* continued GHA work

* try another approach

* testing

* adding comment via GHA

* added uses for GHA

* more debugging

* fixed formatting

* another comment attempt

* remove read permission

* add label check

* fix quotes

* checking label logic

* test forcing failure

* remove extra script tag

* removed logic for having changelog

* Revert "removed logic for having changelog"

This reverts commit 490bda8.

* remove unused workflow section

* update header and readme

* update with current version of changelog

* add step failure for missing changelog file

* fix typos and formatting

* small tweaks per feedback

* Update so changelog end up onlywith current version, not past

* update changelog to recent contents

* added the rest of our releases to previous release list

* clarifying the readme

* updated to reflect current changelog state

* updated so only 1.1 changes are on main
# Conflicts:
#	CHANGELOG.md

* updated to reflect current state of 1.0.latest

* convert backports to changie entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-115] Automate Changelog
8 participants