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

fix: disable profile CI when building reference docs #2367

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@

<!--maven-resources-plugin:3.2.0:copy-resources fails: https://issues.apache.org/jira/browse/MSHARED-966-->
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<!-- override version inherited from spring-cloud-build parent to one that is available on Maven Central -->
<spring-asciidoctor-backends.version>0.0.4</spring-asciidoctor-backends.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not needed because asciidoctor backend version is 0.0.5 and available on Maven central.

</properties>



<profiles>
<profile>
<id>docs</id>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/firestore.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ include::{project-root}/spring-cloud-gcp-data-firestore/src/test/java/com/google

[source, java, indent=0]
----
include::{project-root}/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/it/FirestoreIntegrationTestsConfiguration.java[tag=user_service_bean]
include::{project-root}/spring-cloud-gcp-data-firestore/src/test/java/com/google/cloud/spring/data/firestore/FirestoreIntegrationTestsConfiguration.java[tag=user_service_bean]
----

After that, you can autowire your service like so:
Expand Down
8 changes: 7 additions & 1 deletion docs/src/main/asciidoc/ghpages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ function switch_to_tag() {
# Build the docs if switch is on
function build_docs_if_applicable() {
if [[ "${BUILD}" == "yes" ]] ; then
./mvnw clean install -P docs -pl docs -DskipTests -q
# Disable profile CI (inherited from spring-cloud-build/pom.xml) so
# process-asciidoc can be executed in GH action runner.
# Profile CI will be activated in GH action runner because
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel the profile name "CI" and its activation condition are bad. Is it clear why the profile "CI" is set up like that?

Copy link
Member

Choose a reason for hiding this comment

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

CI profile was introduced based on this issue:
spring-cloud/spring-cloud-build#239

Don't access spring-doc-resources in CI builds[, because it] requires authentication to retrieve.

Copy link
Contributor

Choose a reason for hiding this comment

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

That assumption (pull request builds = GitHub Actions) is wrong. Now I know it's outside our codebase.

# there's env.GITHUB_API_URL defined in the environment by
# default.
# See https://github.com/spring-cloud/spring-cloud-build/blob/v4.0.5/pom.xml#L1638-L1652.
./mvnw clean install -P docs -P '!CI' -pl docs -DskipTests
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @lqiu96's help for debugging the root cause of process-asciidoc is not executed in GH action runner.

I intended to remove -q from the maven command for logging purpose.

fi
}

Expand Down