Skip to content

Conversation

@gengliangwang
Copy link
Member

What changes were proposed in this pull request?

Make the API key of DocSearch configurable and avoid hardcoding in the HTML template

Why are the changes needed?

After #30292, our Spark documentation site supports searching.
However, the default API key always points to the latest release doc. We have to set different API keys for different releases. Otherwise, the search results are always based on the latest documentation(https://spark.apache.org/docs/latest/) even when visiting the documentation of previous releases.

As per discussion in #30292 (comment), we should make the API key configurable and set different values for different releases.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manual test

@github-actions github-actions bot added the DOCS label Nov 18, 2020
MESOS_VERSION: 1.0.0
SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK
SPARK_GITHUB_URL: https://github.com/apache/spark
# Before a new release, we should apply a new `apiKey` for the new Spark documentation
Copy link
Member Author

Choose a reason for hiding this comment

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

An alternative way is, we apply a new API key for the previous release instead. For example,
we are going to release 3.1.1 and the current release is 3.1.0. We apply a new API key for https://spark.apache.org/docs/3.1.0 and publish it. After that, we publish 3.1.1 with the default API key which points to the latest doc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah

@gengliangwang
Copy link
Member Author

cc @beliefer @gatorsmile @maropu @sarutak , since you have reviewed #30292

# documentation of previous releases.
DOCSEARCH_SCRIPT: |
docsearch({
apiKey: 'b18ca3732c502995563043aa17bc6ecb',
Copy link
Member Author

Choose a reason for hiding this comment

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

Even if we don't set different API keys for different releases, I think it makes sense to avoid hardcoding in the HTML template.

Copy link
Member

Choose a reason for hiding this comment

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

It makes sense.

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Test build #131276 has finished for PR 30409 at commit 2da48ff.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35880/

@sarutak
Copy link
Member

sarutak commented Nov 18, 2020

Seems fine to me except the minor issue @maropu pointed out.

By the way, though it's not the thing done in this PR, we should also update the release process right?

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35880/

@gengliangwang
Copy link
Member Author

By the way, though it's not the thing done in this PR, we should also update the release process right?

@sarutak sure, we should update it after this one is merged.

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Test build #131280 has finished for PR 30409 at commit b42cf1f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu maropu changed the title [SPARK-33479][Doc] Make the API Key of DocSearch configurable [SPARK-33479][DOC] Make the API Key of DocSearch configurable Nov 18, 2020
@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35884/

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35884/

Copy link
Contributor

@beliefer beliefer left a comment

Choose a reason for hiding this comment

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

LGTM

MESOS_VERSION: 1.0.0
SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK
SPARK_GITHUB_URL: https://github.com/apache/spark
# Before a new release, we should apply a new `apiKey` for the new Spark documentation
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah

@maropu maropu closed this in 4267ca9 Nov 19, 2020
@maropu
Copy link
Member

maropu commented Nov 19, 2020

Thanks! Merged to master.

@gengliangwang
Copy link
Member Author

@maropu @sarutak @beliefer Thanks for the review.
As for updating the release process, I am trying to apply a new API key for https://spark.apache.org/docs/3.1.0 . I would like to see if I can get the API key before the doc site actually published.

@beliefer
Copy link
Contributor

@maropu @sarutak @beliefer Thanks for the review.
As for updating the release process, I am trying to apply a new API key for https://spark.apache.org/docs/3.1.0 . I would like to see if I can get the API key before the doc site actually published.

Yes, we should try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants