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 a workflow to print bundle size #150

Merged
merged 16 commits into from
Dec 25, 2024
Merged

Add a workflow to print bundle size #150

merged 16 commits into from
Dec 25, 2024

Conversation

illright
Copy link
Member

@illright illright commented Dec 17, 2024

Closes #148. I wanted to find an existing solution, but they all suck in some ways, so I just decided to write my own one

Copy link

changeset-bot bot commented Dec 17, 2024

⚠️ No Changeset found

Latest commit: 5adf502

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@illright illright marked this pull request as draft December 17, 2024 01:20
@illright illright marked this pull request as ready for review December 19, 2024 22:24
@illright illright requested a review from daniilsapa December 20, 2024 01:35
@illright
Copy link
Member Author

The trusted part of the workflow won't work until we merge, so we'll have to wait with testing

@daniilsapa
Copy link
Collaborator

Wonderful job! I'm wondering why you had to split it into two parts.

@illright
Copy link
Member Author

It has to do with security. The untrusted part of the workflow runs on the PR branch, and theoretically, someone could submit a malicious PR that changes the workflow to do something bad. We wouldn't want to run this workflow with a token that has write access, so GitHub runs it with the read access by default. However, that means we don't have permissions to "write" comments on PRs.

In this setup, we run a read-only workflow in untrusted land and then publish a plain-text artifact that can then be safely downloaded and parsed in the trusted land without executing any unsafe code

@daniilsapa
Copy link
Collaborator

Got it. I'm not a big pro in GH Actions, so it may sound stupid to you, but can't we just do all the needed jobs in the "trusted land"? So we don't split the workflow into 2 parts and keep it simpler

@illright
Copy link
Member Author

We can't, because the reason why the trusted land is trusted is because there is no external code from the PR :) We want to run some safe operations on external code in untrusted land (i.e. counting the bundle size) and then publish a comment in trusted land

@daniilsapa
Copy link
Collaborator

Got it, then yes, let's end the "Guardians of the Trusted Land" saga 😂 and merge it

guardians-of-the-trusted-land

Copy link

pkg-pr-new bot commented Dec 24, 2024

Open in Stackblitz

npm i https://pkg.pr.new/feature-sliced/steiger@150
npm i https://pkg.pr.new/feature-sliced/steiger/@feature-sliced/steiger-plugin@150
npm i https://pkg.pr.new/feature-sliced/steiger/@steiger/toolkit@150

commit: 5adf502

@illright illright merged commit caa9ede into master Dec 25, 2024
15 checks passed
@illright illright deleted the bundle-size branch December 25, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a bundle size check to PRs
2 participants