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

Add task to generate release body #233

Merged
merged 8 commits into from
Feb 23, 2022
Merged

Add task to generate release body #233

merged 8 commits into from
Feb 23, 2022

Conversation

csegarragonz
Copy link
Collaborator

@csegarragonz csegarragonz commented Feb 23, 2022

In this PR I introduce a task to generate the body for a new release.

We use the git-cliff project through their docker image to generate a changelog between the current tag and the latest release's tag.

I have customised the format of the release body a bit to fit our Github usage (i.e. squash commits). This is orthogonal to any automation efforts we want to do in the future.

I paste what the release body would look like now for discussion (note that we are missing this actual PR, hence why we see three dangling commits at the beginning).

=====

Faabric's Changelog

Here is what has changed since last release:

[0.3.1] - 2022-02-23

[0.3.0] - 2022-02-11

[0.2.3] - 2021-12-20

[0.2.1] - 2021-10-27

@csegarragonz csegarragonz self-assigned this Feb 23, 2022
@csegarragonz csegarragonz changed the title Release Add task to generate release body Feb 23, 2022
tasks/git.py Outdated
"""
docker_cmd = [
"docker run -t -v",
"{}/..:/app/".format(PROJ_ROOT),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: this only works if faabric is used as a submodule in faasm. This is because, as a submodule, the .git folder is a softlink to ../.git/modules/faabric.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't assume this, Faabric should be treated as a separate library and worked on in a separate checkout. Editing Faabric as a submodule of Faasm should be the exception not the rule.

Copy link
Collaborator

@Shillaker Shillaker left a comment

Choose a reason for hiding this comment

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

Nice one, this looks good. I think we can go one step further and actually do the release from the command. See the equivalent command in Faasm: https://github.com/faasm/faasm/blob/main/faasmcli/faasmcli/tasks/release.py#L152

Splitting it into creating and then publishing the release is probably good for now, but can eventually be merged into one step.

tasks/git.py Outdated
"""
docker_cmd = [
"docker run -t -v",
"{}/..:/app/".format(PROJ_ROOT),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't assume this, Faabric should be treated as a separate library and worked on in a separate checkout. Editing Faabric as a submodule of Faasm should be the exception not the rule.

@Shillaker
Copy link
Collaborator

@csegarragonz let's also remove the commit bodies and just include the headline commits. There are links to the PRs that people can click on if they want more detail.

@Shillaker
Copy link
Collaborator

@csegarragonz finally, do we need to add git-cliff to requirements.txt?

@csegarragonz
Copy link
Collaborator Author

@Shillaker we don't need to add git-cliff as a dependency, as we rely on the docker image to run it. further, git-cliff is written in rust, what means that we couldn't use pip to manage its installation anyway.

i add the new release body format in the updated pr description, i agree with you and think it is more concise and readable.

@csegarragonz csegarragonz added the ci Continuous integration label Feb 23, 2022
@Shillaker
Copy link
Collaborator

Ah whoops, sorry I'd assumed git-cliff was a python module. Interesting choice to go with Rust...

Copy link
Collaborator

@Shillaker Shillaker 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. Only possible issue is with the docs, I think those inv commands won't work but may be wrong.

First, generate a draft release:

```bash
inv git.release_create
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this will work, I have a feeling Invoke will replace all underscores with hyphens.

Copy link
Collaborator Author

@csegarragonz csegarragonz Feb 23, 2022

Choose a reason for hiding this comment

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

It works for me locally (source ./bin/workon.sh && inv -l I see underscores). The same does not happen in faasm.

We use different invoke versions (1.6.0 and 1.5.0 respectively) but I can't see anything about such changes in their changelog.

@csegarragonz csegarragonz merged commit b11e8ab into main Feb 23, 2022
@csegarragonz csegarragonz deleted the release branch February 23, 2022 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants