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

SOLR-16880: Add OAS to 'assembleRelease' task #2125

Merged

Conversation

gerlowskija
Copy link
Contributor

This adds our OAS to the release artifacts gathered by the 'assembleRelease' task in gradle. It produces a checksum for the OAS file and stores the file in a separate 'oas' directory (similar to the 'changes' directory which already exists for Changes.html).

One remaining piece here is signing - this commit attempts to produce an '*.asc' signature for the OAS when signing is enabled, but doesn't quite have it working yet.

https://issues.apache.org/jira/browse/SOLR-16880

Description

Solr has, for some time, produced an OpenAPI spec ("OAS") describing its v2 APIs that it uses to (e.g.) generate Solr clients in various languages. But while it uses the file internally, Solr doesn't (yet) expose the file to users who may wish to do similar things.

Solution

This PR proposes that we publish our openapi spec as a release artifact akin to the various Changes.html files that we also put in artifacts.apache.org. It does this by modifying the gradle tasks (esp. 'assembleRelease') in the 'distribution' gradle module.

Tests

Manual testing via the buildAndPushRelease.py script and the smoke tester.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added documentation for the Reference Guide

This adds our OAS to the release artifacts gathered by the
'assembleRelease' task in gradle.  It produces a checksum for the OAS
file and stores the file in a separate 'oas' directory (similar to the
'changes' directory which already exists for Changes.html).

One remaining piece here is signing - this commit attempts to produce an
'*.asc' signature for the OAS when signing is enabled, but doesn't quite
have it working yet.
@gerlowskija
Copy link
Contributor Author

One TODO remaining, if we choose to go this route, is to produce an "*.asc" signature for the OAS file. The PR currently contains some logic that tries to do this, but it's still not working for whatever reason. Something to work through at some point...

@gerlowskija
Copy link
Contributor Author

Alright, worked through the signing issues with some help (Thanks @HoustonPutman !). This should be functional and ready to go, assuming it's the route we want to take.

@gerlowskija gerlowskija marked this pull request as ready for review December 7, 2023 21:32
@@ -28,7 +28,7 @@ ext {
jsClientDir = "${buildDir}/generated/js"
pythonClientDir = "${buildDir}/generated/python"
openApiSpecDir = "${buildDir}/generated/openapi"
openApiSpecFile = "${project.openApiSpecDir}/openapi.json"
openApiSpecFile = "${project.openApiSpecDir}/solr-${version}-openapi.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

For JARs, the version is at the end. Maybe we should do similar? Just a thought.

@dsmiley
Copy link
Contributor

dsmiley commented Dec 7, 2023

Does anything test this, or must it be manually inspected? Basically, how do we have confidence that this is basically working?

Copy link
Contributor

@janhoy janhoy left a comment

Choose a reason for hiding this comment

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

LGTM. Agree a better name is solr-openapi-x.y.z. And I'd wish for .yml which I find easier to read and diff, but that's mainly taste.

Wrt test, the smoke tester would do something obviously.

@gerlowskija
Copy link
Contributor Author

Does anything test this, or must it be manually inspected?

I've been validating using the buildAndPushRelease.py script, paired with the smoketester. As far as I know we don't have anything else around that validates our build/release automation itself? This is one of the reasons I volunteered to be a possible RM over in dev@; I'd hate for something to go wrong and leave someone else on the hook for it.


Actually, finding the right invocation of buildAndPushRelease.py was a bit of a pain, so I'll share it here just in case it helps anyone that wants to validate or stumbles across a need down the road...

$ echo "foo" | gpg --detach-sign --use-agent --pinentry-mode loopback --local-user <keypair-fingerprint>
$ python3 -u dev-tools/scripts/buildAndPushRelease.py  --push-local <some-output-dir>  --rc-num 1 --mf-username gerlowskija --sign <keypair-fingerprint> --gpg-pass-noprompt

The first command sets up gpg-agent to delegate your password when buildAndPushRelease.py asks for it. It should prompt you for your password and then you're free to go "get some coffee", as the releaseWizard puts it.

@gerlowskija
Copy link
Contributor Author

Agree a better name is solr-openapi-x.y.z

OK, that makes sense. Will make that change later this morning and merge.

@gerlowskija gerlowskija merged commit 955074b into apache:main Dec 14, 2023
1 of 2 checks passed
@gerlowskija gerlowskija deleted the SOLR-16880-add-oas-to-release-main branch December 14, 2023 17:36
gerlowskija added a commit that referenced this pull request Dec 14, 2023
Modifies our 'assembleRelease' gradle task and smoketester to handle a
new release artifact: an OpenAPI spec ("OAS") covering Solr's v2 APIs.

The spec (along with associated checksum and signature files) are made
available under a separate 'openApi' directory, similar to our 'changes' files.
---------

Co-authored-by: Houston Putman <houston@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants