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

[STRATCONN-3673] - Minor fixes to github scripts and adds test instructions #1970

Merged
merged 5 commits into from
Apr 4, 2024

Conversation

varadarajan-tw
Copy link
Contributor

@varadarajan-tw varadarajan-tw commented Apr 4, 2024

This PR makes some minor fixes to create-github-release and compute-labels workflow.

  • Adds DRY_RUN mode for both the github scripts
  • Removes GET RELEASE TAG step and moves it to create-github-release script
  • Fixes changelog formatting

Testing

Testing completed successfully in local

Compute Labels

image

Release script

image

@varadarajan-tw varadarajan-tw changed the title [Formatting and refactor - publish workflow] [STRATCONN-3673] - Fixes formatting of release log Apr 4, 2024
@varadarajan-tw varadarajan-tw changed the title [STRATCONN-3673] - Fixes formatting of release log [STRATCONN-3673] - Minor fixes to github scripts and adds test instructions Apr 4, 2024
@@ -1,21 +1,17 @@
// This is a github action script and can be run only from github actions. To run this script locally, you need to mock the github object and context object.
module.exports = async ({ github, context, core, exec }) => {
const { GITHUB_SHA, RELEASE_TAG } = process.env
const { data } = await github.rest.search.commits({
q: `Publish repo:${context.repo.owner}/${context.repo.repo}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github search is unable to filter commits with just Publish message. So, decided to use git cli itself for searching the recent two "Publish" commits.

const prs = await getPRsBetweenCommits(github, context, core, previousPublish, newPublish)

const newReleaseTag = RELEASE_TAG
// Get tag for the current release
const newReleaseTag = await getReleaseTag(core, exec)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also moved Get Release Tag step from publish.yml to this script. We can use a simple git command to extract the current release tag

@varadarajan-tw varadarajan-tw marked this pull request as ready for review April 4, 2024 08:16

The `release` job uses `create-github-release` script to compute changelog and creates a release. This job has dependency on `build-and-publish` job to finish publishing lerna packages. To test this job in local, comment on the [needs](https://github.com/segmentio/action-destinations/blob/6f55e6f051c214754f9fb9b213ddad6764ba3f18/.github/workflows/publish.yml#L61) attribute and run the following command. The PAT token used here should have permission to create release. When DRY_RUN is set to true, the `create-github-release` doesn't create a release and instead just prints the changelog.

**Note:** When DRY_RUN is set to true, the workflow won't update the PR but instead just print the labels to be added or removed.
Copy link
Contributor

@joe-ayoub-segment joe-ayoub-segment Apr 4, 2024

Choose a reason for hiding this comment

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

is this line needed? seems like it is more relevant to ## Testing compute-labels script

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's just copy paste gone bad! Fixed it. Thanks for catching.

@varadarajan-tw varadarajan-tw merged commit 6e021c2 into main Apr 4, 2024
11 checks passed
@varadarajan-tw varadarajan-tw deleted the cosmetic-fixes-workflow branch April 4, 2024 14:54
harsh-joshi99 added a commit that referenced this pull request Apr 8, 2024
commit f530cc1
Author: Harsh Joshi <harsh.joshi@segment.com>
Date:   Mon Apr 8 14:45:23 2024 +0530

    Update action name

commit d56403a
Author: Maryam Sharif <maryam.sharif@segment.com>
Date:   Fri Apr 5 10:50:47 2024 -0700

    Publish

     - @segment/actions-shared@1.86.0
     - @segment/browser-destination-runtime@1.35.0
     - @segment/actions-core@3.105.0
     - @segment/action-destinations@3.258.0
     - @segment/destinations-manifest@1.49.0
     - @segment/analytics-browser-actions-1flow@1.18.0
     - @segment/analytics-browser-actions-adobe-target@1.36.0
     - @segment/analytics-browser-actions-algolia-plugins@1.13.0
     - @segment/analytics-browser-actions-amplitude-plugins@1.36.0
     - @segment/analytics-browser-actions-braze-cloud-plugins@1.39.0
     - @segment/analytics-browser-actions-braze@1.39.0
     - @segment/analytics-browser-actions-bucket@1.16.0
     - @segment/analytics-browser-actions-cdpresolution@1.23.0
     - @segment/analytics-browser-actions-commandbar@1.36.0
     - @segment/analytics-browser-actions-devrev@1.23.0
     - @segment/analytics-browser-actions-friendbuy@1.36.0
     - @segment/analytics-browser-actions-fullstory@1.38.0
     - @segment/analytics-browser-actions-google-analytics-4@1.42.0
     - @segment/analytics-browser-actions-google-campaign-manager@1.26.0
     - @segment/analytics-browser-actions-heap@1.36.0
     - @segment/analytics-browser-hubble-web@1.22.0
     - @segment/analytics-browser-actions-hubspot@1.36.0
     - @segment/analytics-browser-actions-intercom@1.37.0
     - @segment/analytics-browser-actions-iterate@1.36.0
     - @segment/analytics-browser-actions-jimo@1.24.0
     - @segment/analytics-browser-actions-koala@1.36.0
     - @segment/analytics-browser-actions-logrocket@1.36.0
     - @segment/analytics-browser-actions-pendo-web-actions@1.25.0
     - @segment/analytics-browser-actions-playerzero@1.36.0
     - @segment/analytics-browser-actions-replaybird@1.17.0
     - @segment/analytics-browser-actions-ripe@1.36.0
     - @segment/analytics-browser-actions-rupt@1.25.0
     - @segment/analytics-browser-actions-screeb@1.36.0
     - @segment/analytics-browser-actions-utils@1.36.0
     - @segment/analytics-browser-actions-snap-plugins@1.17.0
     - @segment/analytics-browser-actions-sprig@1.36.0
     - @segment/analytics-browser-actions-stackadapt@1.36.0
     - @segment/analytics-browser-actions-survicate@1.12.0
     - @segment/analytics-browser-actions-tiktok-pixel@1.33.0
     - @segment/analytics-browser-actions-upollo@1.36.0
     - @segment/analytics-browser-actions-userpilot@1.36.0
     - @segment/analytics-browser-actions-vwo@1.37.0
     - @segment/analytics-browser-actions-wiseops@1.36.0

commit d3a85b1
Author: maryamsharif <99763167+maryamsharif@users.noreply.github.com>
Date:   Fri Apr 5 10:44:44 2024 -0700

    retlOnMappingSave Hook (#1969)

    * Merge branch hooks/retlOnMappingSave

    * Add unit tests

    * Address comments

commit 35def89
Author: Joe Ayoub <joe.ayoub@segment.com>
Date:   Fri Apr 5 11:07:50 2024 +0100

    Publish

     - @segment/actions-shared@1.85.0
     - @segment/browser-destination-runtime@1.34.0
     - @segment/actions-core@3.104.0
     - @segment/action-destinations@3.257.0
     - @segment/destinations-manifest@1.48.0
     - @segment/analytics-browser-actions-1flow@1.17.0
     - @segment/analytics-browser-actions-adobe-target@1.35.0
     - @segment/analytics-browser-actions-algolia-plugins@1.12.0
     - @segment/analytics-browser-actions-amplitude-plugins@1.35.0
     - @segment/analytics-browser-actions-braze-cloud-plugins@1.38.0
     - @segment/analytics-browser-actions-braze@1.38.0
     - @segment/analytics-browser-actions-bucket@1.15.0
     - @segment/analytics-browser-actions-cdpresolution@1.22.0
     - @segment/analytics-browser-actions-commandbar@1.35.0
     - @segment/analytics-browser-actions-devrev@1.22.0
     - @segment/analytics-browser-actions-friendbuy@1.35.0
     - @segment/analytics-browser-actions-fullstory@1.37.0
     - @segment/analytics-browser-actions-google-analytics-4@1.41.0
     - @segment/analytics-browser-actions-google-campaign-manager@1.25.0
     - @segment/analytics-browser-actions-heap@1.35.0
     - @segment/analytics-browser-hubble-web@1.21.0
     - @segment/analytics-browser-actions-hubspot@1.35.0
     - @segment/analytics-browser-actions-intercom@1.36.0
     - @segment/analytics-browser-actions-iterate@1.35.0
     - @segment/analytics-browser-actions-jimo@1.23.0
     - @segment/analytics-browser-actions-koala@1.35.0
     - @segment/analytics-browser-actions-logrocket@1.35.0
     - @segment/analytics-browser-actions-pendo-web-actions@1.24.0
     - @segment/analytics-browser-actions-playerzero@1.35.0
     - @segment/analytics-browser-actions-replaybird@1.16.0
     - @segment/analytics-browser-actions-ripe@1.35.0
     - @segment/analytics-browser-actions-rupt@1.24.0
     - @segment/analytics-browser-actions-screeb@1.35.0
     - @segment/analytics-browser-actions-utils@1.35.0
     - @segment/analytics-browser-actions-snap-plugins@1.16.0
     - @segment/analytics-browser-actions-sprig@1.35.0
     - @segment/analytics-browser-actions-stackadapt@1.35.0
     - @segment/analytics-browser-actions-survicate@1.11.0
     - @segment/analytics-browser-actions-tiktok-pixel@1.32.0
     - @segment/analytics-browser-actions-upollo@1.35.0
     - @segment/analytics-browser-actions-userpilot@1.35.0
     - @segment/analytics-browser-actions-vwo@1.36.0
     - @segment/analytics-browser-actions-wiseops@1.35.0

commit b124efd
Author: Joe Ayoub <joe.ayoub@segment.com>
Date:   Fri Apr 5 11:06:23 2024 +0100

    minor commit to check publish

commit 79cdd99
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Fri Apr 5 11:01:30 2024 +0100

    Publish from release branch (#1973)

    * minor update to an Action Destination

    * updating publish to allow from release branch

    * updating

    * Publish

     - @segment/action-destinations@3.256.0

commit 6e021c2
Author: Varadarajan V <109586712+varadarajan-tw@users.noreply.github.com>
Date:   Thu Apr 4 20:24:08 2024 +0530

    [STRATCONN-3673] -  Minor fixes to github scripts and adds test instructions (#1970)

    * Some cosmetic fixes to release workflow

    * Add testing instructions

    * Update TESTING.md

    * Add comments to improve readability of the script

    * add comments
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.

2 participants