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

Publish Haddocks from CI as part of release #144

Merged
merged 4 commits into from
Feb 20, 2024
Merged

Publish Haddocks from CI as part of release #144

merged 4 commits into from
Feb 20, 2024

Conversation

pbrisbin
Copy link
Member

@pbrisbin pbrisbin commented Feb 14, 2024

Since implementing Kafka functionality, Hackage has been unable to build
our Haddocks due to the system library requirement that introduced.
Since then, we've been sporadically uploading docs using the
docs/upload script, which relied on (nix and) cabal to use its
--haddock-for-hackage flag.

With the release of stack-v2.15, we can now:

  • Use its new --haddock --haddock-for-hackage options
  • Use the new stack upload -d option
  • Use HACKAGE_KEY to authorize stack for uploads

So we can do all of this on CI, without incurring the need to use cabal
instead of Stack there. We also don't really need stack-upload-action
anymore, so that's been removed.

I decided to add an additional build within release.yml, rather than:

  1. Conditionally release from ci.yml after building, or
  2. Attempting to upload artifacts from ci.yml for use in release.yml

The reason for this is:

  • It made this the simplest change to accomplish the goal
  • It's somewhat valuable to add a requirement the thing builds before
    releasing, which wasn't the case before
  • The addition of Haddocks makes the build 23m cached-or-not, which we
    don't want to do except during release, and is fine to do post-merge,
    which is not holding anyone up

@pbrisbin pbrisbin changed the title pb/docs Publish Haddocks from CI as part of release Feb 15, 2024
Since implementing Kafka functionality, Hackage has been unable to build
our Haddocks due to the system library requirement that introduced.
Since then, we've been sporadically uploading docs using the
`docs/upload` script, which relied on (nix and) cabal to use its
`--haddock-for-hackage` flag.

With the release of stack-v2.15, we can now:

- Use its new `--haddock --haddock-for-hackage` options
- Use the new `stack upload -d` option
- Use `HACKAGE_KEY` to authorize `stack` for uploads

So we can do all of this on CI, without incurring the need to use cabal
instead of Stack there. We also don't really need `stack-upload-action`
anymore, so that's been removed.

I decided to add an additional build within `release.yml`, rather than:

1. Conditionally release from `ci.yml` after building, or
2. Attempting to upload artifacts from `ci.yml` for use in `release.yml`

The reason for this is:

- It made this the simplest change to accomplish the goal
- It's somewhat valuable to add a requirement the thing builds before
  releasing, which wasn't the case before
- The addition of Haddocks makes the build 23m cached-or-not, which we
  don't want to do except during release, and is fine to do post-merge,
  which is not holding anyone up
@pbrisbin pbrisbin marked this pull request as ready for review February 20, 2024 17:13
- if: steps.tag.outputs.tag
uses: freckle/stack-upload-action@v2
- run: |
stack --stack-yaml stack-lts-18.28.yaml upload --pvp-bounds lower .
Copy link
Contributor

Choose a reason for hiding this comment

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

Why such an old resolver here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually meant to comment this and will now, but:

The --pvp-bounds lower option uses the resolver to decide the lower bounds. Since this is the oldest resolver we test with, the versions of the packages in this resolver are exactly what we want to be our lower bounds.

https://illuminate.atlassian.net/wiki/spaces/EN/pages/17185976662/Preferred+Supported+Compilers+in+Haskell+OSS#Lower-Bounds

@chris-martin
Copy link
Contributor

Haddock in the release workflow only seems fine. I would love to someday have "haddocks build without warning" asserted in CI though.

- Float `env` out to Job-level
- Add a little whitespace
- Add `name` to `stack upload` steps
- Comment why the old resolver
@pbrisbin
Copy link
Member Author

I would love to someday have "haddocks build without warning" asserted in CI though.

Me too, but I think that's going to require upstream improvements in how the build vs docs interact before that's possible. Making a cached build in this project go from 2m to 23m is potentially worth it, but it's absolutely untenable in a project like fancy-api, where it would move the cached build time to over an hour.

@pbrisbin pbrisbin enabled auto-merge (rebase) February 20, 2024 18:47
@pbrisbin pbrisbin merged commit 7a79923 into main Feb 20, 2024
6 of 7 checks passed
@pbrisbin pbrisbin deleted the pb/docs branch February 20, 2024 18:51
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