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

new(ci): autogenerate release body. #2812

Merged
merged 3 commits into from
Sep 21, 2023
Merged

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Sep 15, 2023

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area CI

What this PR does / why we need it:

This PR autogenerates release body with:

Moreover, the RELEASE.md file is updated.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Keeping this as wip because we need leodido/rn2md#11 first (the composite action that the release workflow is now using).

Does this PR introduce a user-facing change?:

NONE

@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 15, 2023

This is not needed for Falco 0.36.0, even if it would be a nice to have.
Let's see if we can put this in.

@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 15, 2023

/cc @leogr

@poiana poiana requested a review from leogr September 15, 2023 14:43
@@ -122,3 +122,39 @@ jobs:
is_latest: ${{ needs.release-settings.outputs.is_latest == 'true' }}
tag: ${{ github.event.release.tag_name }}
sign: true

release-body:
needs: [release-settings, publish-docker]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only at the end of the publish!

@FedeDP FedeDP force-pushed the new/autogenerate_release_body branch 4 times, most recently from d852828 to 01a8361 Compare September 15, 2023 15:05
@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 19, 2023

/milestone 0.37.0

@poiana poiana added this to the 0.37.0 milestone Sep 19, 2023
@FedeDP FedeDP changed the title wip: new(ci): autogenerate release body. new(ci): autogenerate release body. Sep 20, 2023
@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 20, 2023

This is now ready. See the composite action leodido/rn2md in action: https://github.com/FedeDP/rn2md/actions/runs/6245532470/job/16954354425

I think we might give this a shot for 0.36.0 to replace some manual tasks for the release, but given the time constraint we might skip this. (note however that even if this fails, nothing wrong happens because the new job only pushes the release body; worst case scenario is that we need to fill in the body manually, just like we used to do; best case, it will be automatically done by this. I see no risk involved with merging this.
Also, as i shared above, i tested the composite action just fine; everything else is the part of the code we use in the libs automation to upload a release body.)

/cc @leogr @LucaGuerra

Andreagit97
Andreagit97 previously approved these changes Sep 20, 2023
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

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

/approve

Comment on lines 155 to 159
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ./release-body.md
tag_name: ${{ github.event.release.tag_name }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remember that this entire workflow reacts to the creation of a new release. Wouldn't this create another one?

Copy link
Contributor Author

@FedeDP FedeDP Sep 20, 2023

Choose a reason for hiding this comment

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

I think it will just update the existing one; perhaps i need to add name: input though! Thanks for the suggestion btw

Name of the release. defaults to tag name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But yep i totally forgot about prereleases and draft; this should only run on final releases.
I will update the workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok i should've fixed it. PTAL :)

Copy link
Contributor

Choose a reason for hiding this comment

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

My question is more like: is https://github.com/softprops/action-gh-release able to modify an existing release? So, have you tried creating an empty repository with a pipeline which reacts to this

on:
  release:
    types: [published]

and check if it is able to update the release body that you added? It is possible that you did or that the manual states it somewhere but from a quick look I didn't find it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, this is the same action used by libs; on libs, you create a release (not a tag) BUT the workflow triggers on tag. Anyway, the action updates the existing github release.
Also, the action is able to append body to an existing release (this is what we do in libs actually):

append_body | Boolean | Append to existing body instead of overwriting it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, yes the action CAN update an existing github release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

💡 When the release info keys (such as name, body, draft, prerelease, etc.) are not explicitly set and there is already an existing release for the tag, the release will retain its original info.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(added correct permissions to the job btw)


release-body:
needs: [release-settings, publish-docker]
if: ${{ needs.release-settings.outputs.is_latest == 'true' }} # only for latest releases
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LucaGuerra this should only run for latest releases.

Signed-off-by: Federico Di Pierro <[email protected]>
…erride release name.

Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP FedeDP force-pushed the new/autogenerate_release_body branch from b8d39bb to 688322b Compare September 20, 2023 09:11
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

Will it run for RC, too? 🤔

@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 21, 2023

Only for releases set as latest , so no RCs.

@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 21, 2023

Also, thanks to @leodido who was super fast at reviewing and merging my PRs against rn2md!

Copy link
Contributor

@jasondellaluce jasondellaluce left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Sep 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, jasondellaluce, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,jasondellaluce,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit e836157 into master Sep 21, 2023
15 checks passed
@poiana poiana deleted the new/autogenerate_release_body branch September 21, 2023 19:04
@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 22, 2023

/milestone 0.36.0

@poiana poiana modified the milestones: 0.37.0, 0.36.0 Sep 22, 2023
@FedeDP
Copy link
Contributor Author

FedeDP commented Sep 22, 2023

This does not need to be backported on the release branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants