Skip to content

Conversation

vedansh-5
Copy link
Contributor

@vedansh-5 vedansh-5 commented Aug 4, 2025

📌 Fixes

Fixes #85

📝 Summary of Changes

In this Pull Request I have added workflows that corrects the releases and draft notes, On each PR merge a new release will be drafted and tags will be updated based on semantic versioning and when we manually publish the release it will also be published to chrome web store.


📸 Screenshots / Demo (if UI-related)

Add screenshots, video, or link to deployed preview if applicable


✅ Checklist

  • I’ve tested my changes locally
  • I’ve added tests (if applicable)
  • I’ve updated documentation (if applicable)
  • My code follows the project’s code style guidelines

👀 Reviewer Notes

Add any special notes for the reviewer here

Summary by Sourcery

Streamline release process by correcting release-drafter workflow to draft and tag new releases, automating CHANGELOG.md updates, and adding a publish workflow to deploy the extension to the Chrome Web Store

New Features:

  • Add GitHub Actions workflow that zips and publishes the extension to the Chrome Web Store on manual release

Bug Fixes:

  • Fix release-drafter triggers and configuration to properly draft releases and update tags on PR merges

Enhancements:

  • Automate CHANGELOG.md generation and commit new entries for each release
  • Refine release-drafter configuration with standardized templates and expanded maintenance labels

CI:

  • Update release-drafter workflow to use release-drafter@v6 with publish flag, include checkout, Node.js setup, and changelog steps

Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5 vedansh-5 self-assigned this Aug 4, 2025
Copy link
Contributor

sourcery-ai bot commented Aug 4, 2025

Reviewer's Guide

Streamlines release automation: refactors the release-drafter workflow with automated changelog commits, standardizes the release-drafter config template, and adds a new workflow to publish the extension to the Chrome Web Store.

Flow diagram for automated release and changelog update process

flowchart TD
    PR[Pull Request Merged to master]
    RD[Release Drafter Action]
    CL[Update Changelog]
    CP[Commit & Push Changelog]
    TG[Create Tag]
    PR --> RD
    RD --> CL
    CL --> CP
    CP --> TG
Loading

Flow diagram for Chrome Web Store publish workflow

flowchart TD
    Release[Release Published]
    CO[Checkout Code]
    ZIP[Create ZIP of src/]
    UP[Upload to Chrome Web Store]
    Release --> CO
    CO --> ZIP
    ZIP --> UP
Loading

File-Level Changes

Change Details Files
Refined release-drafter workflow with auto-changelog commits
  • Removed obsolete pull_request_target config
  • Bumped release-drafter action to v6 and enabled publish flag
  • Added checkout, Node.js setup, changelog generation, and auto-commit steps
.github/workflows/release-drafter.yml
Standardized release-drafter configuration template
  • Removed emojis from name-template
  • Reformatted categories and expanded Maintenance labels
  • Reorganized change-template into unified template block and added exclude-labels
.github/release-drafter.yml
Introduced publish-to-chrome workflow for Chrome Web Store releases
  • Created workflow triggered on published releases
  • Added steps to zip extension and authenticate with Chrome Web Store
  • Integrated PlasmoHQ/chrome-extension action
.github/workflows/publish-to-chrome.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#85 Enable automatic deployment of the project to the Chrome Web Store using GitHub Actions.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added the config label Aug 4, 2025
@vedansh-5 vedansh-5 requested review from hpdang and Preeti9764 August 4, 2025 13:08
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vedansh-5 - I've reviewed your changes - here's some feedback:

  • Your changelog commit is pushed back to master and will retrigger the release-drafter job, creating a loop—consider adding paths-ignore: ['CHANGELOG.md'] under on.push to prevent recursion.
  • The exclude-labels: key in .github/release-drafter.yml is empty—either remove it or provide values to avoid a malformed config file.
  • To guard against unintended breakages, pin third-party actions to full SHAs or specific patch versions rather than loose tags like @v6 or @v5.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Your changelog commit is pushed back to master and will retrigger the `release-drafter` job, creating a loop—consider adding `paths-ignore: ['CHANGELOG.md']` under `on.push` to prevent recursion.
- The `exclude-labels:` key in `.github/release-drafter.yml` is empty—either remove it or provide values to avoid a malformed config file.
- To guard against unintended breakages, pin third-party actions to full SHAs or specific patch versions rather than loose tags like `@v6` or `@v5`.

## Individual Comments

### Comment 1
<location> `.github/workflows/release-drafter.yml:60` </location>
<code_context>
+          mv new_changelog_entry.md CHANGELOG.md
+
+      # Commits the updated CHANGELOG.md and creates a tag for the new version
+      - name: Commit and Push Changelog
+        uses: stefanzweifel/git-auto-commit-action@v5
+        with:
+          commit_message: 'docs: Update CHANGELOG.md for ${{ steps.release_drafter.outputs.tag_name }}'
+          file_pattern: 'CHANGELOG.md'
+          tagging_message: ${{ steps.release_drafter.outputs.tag_name }}
+
+
</code_context>

<issue_to_address>
Automatically committing and tagging from within the workflow may create tags that conflict with those created by the release-drafter action.

Coordinate tag creation between this step and the release-drafter action to avoid duplicate tags or push errors. Consider adding logic to skip tag creation if the tag already exists.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +60 to +65
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'docs: Update CHANGELOG.md for ${{ steps.release_drafter.outputs.tag_name }}'
file_pattern: 'CHANGELOG.md'
tagging_message: ${{ steps.release_drafter.outputs.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.

issue (bug_risk): Automatically committing and tagging from within the workflow may create tags that conflict with those created by the release-drafter action.

Coordinate tag creation between this step and the release-drafter action to avoid duplicate tags or push errors. Consider adding logic to skip tag creation if the tag already exists.

Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5
Copy link
Contributor Author

@hpdang @Preeti9764 Please add MAJOR, MINOR and PATCH in the titles of all the PRs that we have been merged or are still open, details on the same in readme changes in this PR. Thankyou :>

Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5
Copy link
Contributor Author

@hpdang This branch can be force-merged successfully, the failing job is a result of the current workflow, I have fixed the concerning code in this PR. thankyou

@hpdang
Copy link
Member

hpdang commented Aug 8, 2025

Please add MAJOR, MINOR and PATCH in the titles of all the PRs that we have been merged or are still open, details on the same in readme changes in this PR. Thankyou :>

@vedansh-5 I think having the PR title with these labels are not so ideal. According to your README, I assume we can use GitHub label instead? I can create a new set of GitHub label. I am thinking to add also "release:none", so we will have the following labels:

  • release:major
  • release:minor
  • release:patch
  • release:none

And do we need to enforce PR labels on each single PR? I am also concerned that newcomers might not know which label is appropriate. What is your opinion?

@hpdang
Copy link
Member

hpdang commented Aug 8, 2025

And in the README, could you please also add a section explaining the release process?

Signed-off-by: Vedansh Saini <[email protected]>
Signed-off-by: Vedansh Saini <[email protected]>
Signed-off-by: Vedansh Saini <[email protected]>
@vedansh-5
Copy link
Contributor Author

@vedansh-5 I think having the PR title with these labels are not so ideal. According to your README, I assume we can use GitHub label instead? I can create a new set of GitHub label. I am thinking to add also "release:none", so we will have the following labels:

  • release:major
  • release:minor
  • release:patch
  • release:none

And do we need to enforce PR labels on each single PR? I am also concerned that newcomers might not know which label is appropriate. What is your opinion?

I have made changes in the workflow to prioritize using the same labels you mentioned here and use the older MAJOR, MINOR, PATCH method as a fallback.
I have also added a section in the readme file for the new labels to give newcomers a better idea for labelling their work, in case the they fail to label it, we can label their work while reviewing, later on we can also add a workflow to comment on the PR for reminding them to add labels and directing the to the concerned section in the readme file.
I have added a section for the release process in the readme file.

@vedansh-5
Copy link
Contributor Author

@hpdang I think adding a contributing guide for this project will be a good idea, I have created a draft for the same, lmk if you'd like to see it, I can raise a PR. Thankyou

@hpdang hpdang merged commit 5924b11 into fossasia:master Aug 11, 2025
1 of 2 checks passed
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.

Deploy project automatically to Chrome Web Store
2 participants