spring-projects / spring-security

Spring Security
http://spring.io/projects/spring-security
Apache License 2.0
8.71k stars 5.85k forks source link

Support updated Sagan API for Contentful #12575

Closed sjohnr closed 1 year ago

sjohnr commented 1 year ago

Expected Behavior

The SaganPlugin needs to send the username parameter for the personal access token.

Current Behavior

The SaganPlugin currently sends not-used as the username, since the Sagan API originally called the /user endpoint with the access token to authenticate the user and discover the GitHub username.

https://github.com/spring-projects/spring-security/blob/fa9c7fb50d54c2b4f669e93f7a2da83c918cb06b/buildSrc/src/main/java/org/springframework/gradle/sagan/SaganApi.java#L36

Context

An updated version of the Sagan API has been deployed to work with Contentful as the backend, and is documented at https://api.spring.io/restdocs/index.html. The updated API does not call the GitHub /user endpoint, and therefore requires the username parameter to be provided in the request.

sjohnr commented 1 year ago

An additional issue with SaganCreateReleaseTask is that the referenceDocUrl contains the {version} placeholder which is automatically filled in by Contentful (worked the same with Sagan). However, our Antora versioning scheme does not place "-SNAPSHOT" in the URL.

For example, a URL such as "https://docs.spring.io/spring-security/reference/5.8.2-SNAPSHOT/index.html" is incorrect. It should be "https://docs.spring.io/spring-security/reference/5.8.2/index.html" even if the version is 5.8.2-SNAPSHOT.