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

Semiautomatic hackage releases #2163

Merged
merged 28 commits into from Sep 9, 2021
Merged

Conversation

jneira
Copy link
Member

@jneira jneira commented Sep 6, 2021

  • This try to make hackage releases as smooth as possible, hopefully fixes Automate hackage releases #1310
  • It is dumb about changes: if some file (module obvious exclusions like docs files) has changed, we have to bomp up the version or it will fail
  • It builds all packages for three last ghc major versions so it will take some time (with cold cache)
  • It upload package candidates, a human should confirm the definitive release (ahopefully fter some manual checks)
  • It depends on Remove ghc-api source snapshot #2156 to avoid errors about ghc-api-compat
  • It is failing for hls-call-hierarchy-plugin:

.github/workflows/hackage.yml Outdated Show resolved Hide resolved
@July541
Copy link
Collaborator

July541 commented Sep 6, 2021

It is caused by aeson's Value, Value support Ord instance after their 1.5.2.0.

I checked your test and found it uses 1.4.7.1...

I think to add a lower bound for aeson in hls-call-hierarchy-plugin is enough (Maybe you can add it directly, I don't know how to participate in this thread..)

@jneira
Copy link
Member Author

jneira commented Sep 6, 2021

I think to add a lower bound for aeson in hls-call-hierarchy-plugin is enough (Maybe you can add it directly, I don't know how to participate in this thread..)

dont worry, the diagnostic is the "hard" part, will add the bound here, thanks!

cd $(ls -d ./incoming/${{ matrix.package }}-*)
echo "packages: . ../../* ../../plugins/*" > cabal.project
# TODO: remove when not needed
echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are only needed to build the benchmark suite of ghcide. The benchmark suite is not a requirement for uploading to Hackage imho, and should be skipped

Copy link
Member Author

Choose a reason for hiding this comment

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

ya, but to use a simple autogenerated cabal.project with packages: . ../../* ../../plugins/* cabal has to find a build plan for shake-bench. The alternative is a cabal project listing explicitly all packages but shake-bench.
Otoh in theory you should be able to run the benchmarks (like tests) with the hackage version too, and ideally those allow-newer should be removed to allow it

if: steps.get-hackage-version.exists != 'true'
run: |
cd $(ls -d ./incoming/${{ matrix.package }}-*)
cabal build --enable-tests --enable-benchmarks
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cabal build --enable-tests --enable-benchmarks
cabal build --enable-tests

Copy link
Member Author

Choose a reason for hiding this comment

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

ideally benchmarks should be able to run using the hackage version

Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

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

Nice job, this is going to be super useful

@pepeiborra
Copy link
Collaborator

Next step would be integrating @kowainik Policeman to validate the updated version numbers: https://kowainik.github.io/projects/policeman

@jneira
Copy link
Member Author

jneira commented Sep 7, 2021

Next step would be integrating @kowainik Policeman to validate the updated version numbers: https://kowainik.github.io/projects/policeman

wow, i had forgotten it, it would be really nice, will open an issue after merging this

@jneira
Copy link
Member Author

jneira commented Sep 7, 2021

I've used a hackage token generated from my account, it can be changed in the project secrets
However i have not perms to upload to all packages involved, missing are:

Most of them have @pepeiborra as unique maitainer so an option could be that @pepeiborra generates a hackage api key (i would create a new, dedicated, one). But even doing that i would add some more maintainers to those plugin with only one parent 😉

EDIT: resolved with a new token with full access, thanks @pepeiborra!

@pepeiborra
Copy link
Collaborator

I have added you to the maintainers list for all of them

@jneira
Copy link
Member Author

jneira commented Sep 7, 2021

Ok the workflow has failed in the last step, cause i did not put the hackage api key:

https://github.com/jneira/haskell-language-server/actions/runs/1208936609

Run haskell-actions/hackage-publish@v1
  with:
    packagesPath: packages
    publish: false
    hackageServer: http://hackage.haskell.org
Uploading hls-module-name-plugin-1.0.0.1 to http://hackage.haskell.org/packages/candidates
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  7777    0     0  100  7777      0  42037 --:--:-- --:--:-- --:--:-- 42037
curl: (22) The requested URL returned error: 401 Unauthorized
Error: Process completed with exit code 22.

I think the deinitive test can be done with the next release

@jneira jneira added the merge me Label to trigger pull request merge label Sep 7, 2021
@pepeiborra
Copy link
Collaborator

It would be nice to back port this to the 1.3.0-hackage branch and use it for the Hackage upload

@jneira
Copy link
Member Author

jneira commented Sep 8, 2021

I was waiting for the automatic backport, but CI is quite slow lately, will backport manually

jneira added a commit that referenced this pull request Sep 8, 2021
@jneira
Copy link
Member Author

jneira commented Sep 8, 2021

@jneira
Copy link
Member Author

jneira commented Sep 8, 2021

As the workflow will take ages to start i've started it in my repo: https://github.com/jneira/haskell-language-server/runs/3545669772

@haskell haskell deleted a comment from mergify bot Sep 9, 2021
@jneira jneira merged commit adb964c into haskell:master Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate hackage releases
4 participants