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

Allow running with multiple configurations #81

Closed
sarayourfriend opened this issue May 3, 2022 · 10 comments
Closed

Allow running with multiple configurations #81

sarayourfriend opened this issue May 3, 2022 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sarayourfriend
Copy link
Contributor

sarayourfriend commented May 3, 2022

Our application (https://github.com/WordPress/openverse-frontend) generates two distinct bundle groups during the build process, a "modern" and "universal" bundle (this is a concept we inherit by using Nuxt). We'd like to have separate compressed size checks for each of the two build types, however, when you try to run the compressed-size-check action twice in one PR, it overwrites the comment.

You can observe the issue in this PR: WordPress/openverse-frontend#1378

If you check the edit history of the bot's comment, you can see that it overwrote itself.

Would y'all accept a PR to add an optional "key"/"id"/"comment-key" (names are hard) input that could be used to specify the comment to update?

Essentially my idea would be to update this conditional to additionally check for the new input in the body: https://github.com/preactjs/compressed-size-action/blob/master/src/index.js#L202-L205

For example, instead of just compressed-size-check being in the body, it could be compressed-size-check::${key} or something along those lines.

Thanks!

@developit
Copy link
Member

developit commented Jun 6, 2022

A comment key configuration would be great! Your proposed implementation sounds right to me.

@developit developit added enhancement New feature or request help wanted Extra attention is needed labels Jun 6, 2022
@sarayourfriend
Copy link
Contributor Author

Hi @developit, I'm going to take a try implementing this today.

@slorber
Copy link
Contributor

slorber commented Sep 26, 2024

+1 for this

Docusaurus is going to ship experimental Rspack support to replace Webpack as an opt-in feature flag. We now need to monitor the build output of 2 different bundlers, and looks like we can't unfortunately.

The closed PR looked fine to me

@sarayourfriend
Copy link
Contributor Author

I've reopened the PR. If you can help wrangle a review @slorber I am happy to make changes or otherwise make it possible to get that change committed.

@rschristian
Copy link
Member

Supported via #82

Thanks again for the patience!

@slorber
Copy link
Contributor

slorber commented Sep 27, 2024

Awesome thanks

Do you plan to do a release soon? Or is there a way to use a "canary" action until then or something? 😄

@rschristian
Copy link
Member

rschristian commented Sep 27, 2024

Will release soon-ish, in the next few days

@sarayourfriend
Copy link
Contributor Author

sarayourfriend commented Sep 27, 2024

Or is there a way to use a "canary" action until then or something? 😄

@slorber you can pin actions to any valid git ref on the main branch of the action repository, not just tags/releases. HEAD is at 4a35a533ce71b6edb72f2049f4c13d0611d17607 as of writing, so something like this would do the trick:

name: Compressed Size
on: [pull_request]
jobs:
  modern-bundle-size-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: preactjs/compressed-size-action@4a35a533ce71b6edb72f2049f4c13d0611d17607
      with:
        build-script: "build:modern"
        comment-key: modern

@slorber
Copy link
Contributor

slorber commented Sep 27, 2024

Thanks! Will try that asap.

@rschristian
Copy link
Member

Just released as 2.7.0/v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants