Skip to content

Test for possible breaking changes by compiling the package set#4165

Closed
JordanMartinez wants to merge 20 commits intopurescript:masterfrom
JordanMartinez:addPackageSet
Closed

Test for possible breaking changes by compiling the package set#4165
JordanMartinez wants to merge 20 commits intopurescript:masterfrom
JordanMartinez:addPackageSet

Conversation

@JordanMartinez
Copy link
Copy Markdown
Contributor

Description of the change

Updates CI to also compile the entire package set in a separate job. I'm creating this so that issues like #4064, which we did not realize was a breaking change, will be caught sooner.

This will cause problems for CI when we want to start merging breaking changes. The fastest way to deal with it would be to comment out the job during then.


Checklist:

  • Added a file to CHANGELOG.d for this PR (see CHANGELOG.d/README.md)
  • Added myself to CONTRIBUTORS.md (if this is my first contribution)
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@f-f
Copy link
Copy Markdown
Member

f-f commented Jul 19, 2021

If this is a separate job we'd need to recompile the binary, which takes a while (since we cannot pass artifacts between jobs).

I think we could instead attach this step to the ubuntu build job, which is the shortest one so far.

@thomashoneyman
Copy link
Copy Markdown
Member

We can share assets between jobs using upload-artifact

@rhendric
Copy link
Copy Markdown
Member

I'm looking into whether we can make this a workflow/job/step that runs only on PRs that don't have the breaking label, so we can avoid cluttering the history with commenting/uncommenting the job.

@thomashoneyman
Copy link
Copy Markdown
Member

thomashoneyman commented Jul 19, 2021

@rhendric we can do that by checking the labels on the pull request -- basically, adding this to the relevant job:

if: ${{ github.event.label.name != 'breaking' }}

@rhendric
Copy link
Copy Markdown
Member

Ah, nice. I think that's the thing to do then, at least for runs triggered by pull requests. I'm not sure what we should do about the builds that run on push to master; like I said, I'm not keen on having some sort of toggle being changed back and forth in the Git history, but I also don't want to lose the signal that those builds provide during the periods when breaking changes are expected.

@thomashoneyman
Copy link
Copy Markdown
Member

We could potentially skip the check on pushes to master, since it will be checked in the PR already. That's not perfect -- things could interact strangely -- but it could get us very close to sure that we haven't introduced a breaking change when we're not supposed to and not require any other futzing around with settings during a period when we are introducing breaking changes.

We might want a label other than 'breaking', though, to indicate that we would like to skip the package set check. For example, if we've already introduced a breaking change then we'd like subsequent pull requests to also skip the check even if they aren't breaking.

@rhendric
Copy link
Copy Markdown
Member

Blast, you're right. I hadn't thought of that. Now I'm not sure what I think. 😁

@f-f
Copy link
Copy Markdown
Member

f-f commented Jul 19, 2021

I think the options are:

  • being fine with disabling the check once breaking changes are in and the package set didn't catch up yet
  • and/or point to an alternative package set that we keep patched (and/or require patching the set when the breaking change goes in)

@hdgarrood
Copy link
Copy Markdown
Contributor

Previously: #2837. (My position on this has softened since then though, I think this probably is a better tradeoff now). I think we won't want to have the check based on PR labels, though, because this test will start failing every time once we have merged one breaking change into master - which would mean that contributors would be encouraged to add a breaking label for every single PR once there is an unreleased breaking change in master, regardless of whether the PR in question is actually breaking.

Disabling the check entirely while there's an unreleased breaking change in master is probably not a bad option. Turning the check off entirely seems a bit crude, but we're probably not losing too much in the case where we do expect there to be breaking changes.

I also think requiring updating an alternative package set before merging would cause too much hassle, unless we are quite aggressive about removing things which no longer compile from that alternative set. We do occasionally need to be able to break things, and it's not feasible for the person who makes a contribution to the compiler to also be responsible for updating the entire ecosystem to handle that change. I could imagine a scenario where, in the periods where we have a breaking change which isn't shipped yet, we point to an alternative package set which, say, only contains the core libraries.

@f-f
Copy link
Copy Markdown
Member

f-f commented Jul 19, 2021

We do occasionally need to be able to break things, and it's not feasible for the person who makes a contribution to the compiler to also be responsible for updating the entire ecosystem to handle that change. I could imagine a scenario where, in the periods where we have a breaking change which isn't shipped yet, we point to an alternative package set which, say, only contains the core libraries.

Right, a requirement along the lines of "the whole package set should still compile" is unreasonable since there are so many packages outside of our control and a change might require forming a big chunk of them, but something like "the package set with core, node, web and contrib should still compile" feels more reasonable.

However, the latter requirement wouldn't catch failures in exotic type-level libraries such as the one triggered by #4064, so maybe reducing the package set size makes this check way less useful?

@hdgarrood
Copy link
Copy Markdown
Contributor

Requiring a successful compile against node, web, and contrib still feels like too much to me personally, especially since this change was partially motivated by us being worried about how long it takes to get compiler PRs merged.

I don't think compiling against a reduced set in the run-up to a breaking change release makes the check that much less useful; it's intended for avoiding accidental breaking changes during non-breaking releases, so it's less relevant in the run-up to a breaking change release. The failure triggered by #4064 would have been caught anyway because at that point we weren't expecting to have any breaking changes, so we would have been compiling against the full set. If we had released that change as part of a breaking release I wouldn't have considered it much of a problem - in that case, I think all we would have needed to do would have been to move the relevant entry from the "new features" section of the release notes into the "breaking changes" section.

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

Reading through the download-artifact readme again, I think my usage of path is telling the action to download purs into the ~/bin/purs directory, so that the full file name would be ~/bin/purs/purs.

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

Anyone got ideas for why spago can't find the purs binary? CI shows that running purs --version works and that it's on the PATH.

https://github.com/purescript/purescript/runs/3147055332#step:8:35

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

Welp! I've exhausted all ideas I can think of. Any ideas? Or should I just close this PR?

@f-f
Copy link
Copy Markdown
Member

f-f commented Jul 27, 2021

@JordanMartinez I'll have a look at this

@JordanMartinez
Copy link
Copy Markdown
Contributor Author

Closing since this never was figured out.

@JordanMartinez JordanMartinez deleted the addPackageSet branch October 22, 2021 18: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.

5 participants