Skip to content

Conversation

@jisantuc
Copy link
Contributor

@jisantuc jisantuc commented Feb 3, 2021

Description of the change
This PR upgrades @actions/* where possible. The reason to do so is that GitHub changed the rules around add-path to address a security vulnerability.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable) I believe that the existing addPath test should verify that this is fine

@colinwahl
Copy link
Member

colinwahl commented Feb 4, 2021

I went ahead and made this change and release v0.2.2 (I messed up v0.2.1 at first...).

I'm going through the steps to get it into the package-set, at which time we can update setup-purescript.

We should still get this change into main, I will come back to this tomorrow and we can work on it.

@jisantuc
Copy link
Contributor Author

jisantuc commented Feb 4, 2021

It feels a little bad that CI is mad about Data.Functor and Data.Array stuff from a js upgrade -- guessing that's 0.14.x related?

@thomashoneyman
Copy link
Collaborator

CI is broken because the 0.14 package set doesn’t currently build — we’re applying some changes to the functors and related libraries. That work will be done in the next day or two and CI will work again then. But if this builds successfully against 0.13.8 then we can still merge it; the CI issue is temporary and only because we’re in a transition right now along with many other core packages.

@jisantuc
Copy link
Contributor Author

jisantuc commented Feb 4, 2021

It does build against 0.13.8: 4a09406

I'll set a reminder to kick the build on Sunday unless y'all want to merge before then

@thomashoneyman
Copy link
Collaborator

All fixed! Thanks, @jisantuc.

@thomashoneyman
Copy link
Collaborator

thomashoneyman commented Feb 5, 2021

Shouldn't we also deprecate the addPath function as is done in the patch we're upgrading to? We could also remove it altogether to get ahead of this change, though we're going to have to figure out what to do in setup-purescript instead.

There are plenty of references to addPath throughout the project code and documentation, including:

Fortunately we don't even have bindings for set-env so there's nothing to do there.

@jisantuc
Copy link
Contributor Author

jisantuc commented Feb 5, 2021

Shouldn't we also deprecate the addPath function as is done in the patch we're upgrading to?

Can we deprecate things in PS? I'm used to Scala's/Python's way of deprecating things with decorators. How do users find out about deprecations in PS?

@thomashoneyman
Copy link
Collaborator

You can use the Warn type class to emit a compiler warning with custom text, which is how we typically handle deprecations. See, for example, in the compiler repo:

https://github.com/purescript/purescript/blob/868eba2be75fb21fc958ed48ace2b6c0897e6640/tests/purs/warning/CustomWarning2.purs#L1-L13

In this case we'd do something like

addPath 
  :: Warn (Text "addPath is deprecated due to a security vulnerability and will be removed in the next release.") 
  => String
  -> Effect Unit

Then, when someone uses the function in their code they'll see a compiler warning containing that text.

@jisantuc
Copy link
Contributor Author

jisantuc commented Feb 5, 2021

Oh that's pretty cool 😎 add0212

Copy link
Collaborator

@thomashoneyman thomashoneyman left a comment

Choose a reason for hiding this comment

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

This is the right idea — we do want to filter these out so as to not fail CI.

@thomashoneyman
Copy link
Collaborator

You can see an example of the syntax for filtering out warnings of this type here:
https://github.com/purescript/purescript-profunctor/blob/master/package.json

i swear i'm not trying to burn all of your github actions minutes
@jisantuc
Copy link
Contributor Author

jisantuc commented Feb 5, 2021

✅ 🎉 thanks for the pointer. Out of curiosity, will that exclude all user-defined warnings, even if a dependency adds a warning about something?

@thomashoneyman
Copy link
Collaborator

It will only censor user-defined warnings in this library. The —censor-lib flag censors warnings from library dependencies.

@thomashoneyman thomashoneyman merged commit 119b0f6 into purescript-contrib:main Feb 6, 2021
@jisantuc jisantuc deleted the bugfix/js/upgrade-actions branch February 7, 2021 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants