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

deps: Bump serve-static to latest, 1.16.2 #5889

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

gnprice
Copy link
Member

@gnprice gnprice commented Sep 18, 2024

Taking this upgrade because we learned from dependabot that it fixes a security issue:
#5887

The issue is in a dev-only indirect dependency, and even our development tools probably don't trigger it. But I can't rule out that they might.

The yarn.lock diff from dependabot is a bit messy, though, so here's me doing the same upgrade directly.


Because this is an indirect dependency, yarn upgrade serve-static just does nothing. (Seems like a bug / misfeature in Yarn.)

And I don't want to do a general yarn upgrade in this legacy codebase right now -- that would balloon into a larger task.

So, here's a fun technique to make the upgrade in a surgical way:

  $ perl -i -0pe 's{^serve-static@.*?\n\K.*?^$}
                   {  version "1.16.2"\n}sm
                 ' yarn.lock
  $ yarn

That deletes the "version", "resolved", and other fields in the lockfile's resolution of the serve-static package, replacing them with just a "version" line pointing at the desired version.

Then rerunning yarn (aka yarn install) starts from that version when filling back in the rest of the details.

@gnprice
Copy link
Member Author

gnprice commented Sep 18, 2024

The CI failure is only in suite native; it's #5888.

Taking this upgrade because we learned from dependabot that it fixes
a security issue:
  zulip#5887

The issue is in a dev-only indirect dependency, and even our
development tools *probably* don't trigger it.  But I can't
rule out that they might.

The yarn.lock diff from dependabot is a bit messy, though,
so here's me doing the same upgrade directly.

---

Because this is an indirect dependency, `yarn upgrade serve-static`
just does nothing.  (Seems like a bug / misfeature in Yarn.)

And I don't want to do a general `yarn upgrade` in this legacy
codebase right now -- that would balloon into a larger task.

So, here's a fun technique to make the upgrade in a surgical way:

  $ perl -i -0pe 's{^serve-static@.*?\n\K.*?^$}
                   {  version "1.16.2"\n}sm
                 ' yarn.lock
  $ yarn

That deletes the "version", "resolved", and other fields in the
lockfile's resolution of the `serve-static` package, replacing them
with just a "version" line pointing at the desired version.

Then rerunning `yarn` (aka `yarn install`) starts from that version
when filling back in the rest of the details.
@gnprice gnprice force-pushed the pr-deps-serve-static branch from 9effe23 to 1d73509 Compare September 19, 2024 00:58
@gnprice
Copy link
Member Author

gnprice commented Sep 19, 2024

Rebased atop #5891, which should fix that failure #5888.

@chrisbobbe
Copy link
Contributor

Thanks for dealing with this! LGTM, merging.

@chrisbobbe chrisbobbe merged commit 8f7c28c into zulip:main Sep 19, 2024
1 check passed
@gnprice gnprice deleted the pr-deps-serve-static branch September 20, 2024 01:14
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.

2 participants