Skip to content

Conversation

@Thesharing
Copy link
Contributor

What is the purpose of the change

This pull request intend to fix broken links to Task Failure Recovery page on Configuration page. In Hugo we can use the variable {{.Site.BaseURL}} to make sure the links are always right no matter where they are. This variable makes sure the links refer to absolute path instead of relative path.

In #16724, we verify the changes by running the local server with Hugo and checking if the links head to the correct page. But it seems {{.Site.BaseURL}} in local server is ended with /, while the remote server that hosts the docs for Flink doesn't. Thus, we need to add the suffix.

Furthermore, we add a variable {{.Site.LanguagePrefix}} to make sure the Chinese version will direct to the page in Chinese version, rather than the English version.

Brief change log

  • Fix broken links in RestartStrategyOptions.java and JobManagerOptions.java
  • Generate the docs based on the modification above

Verifying this change

Run the local server with Hugo and check if the links head to the correct pages.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit e5911d7 (Mon Aug 23 04:12:19 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Aug 23, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

code("fixed-delay"),
link(
"{{.Site.BaseURL}}docs/ops/state/task_failure_recovery#fixed-delay-restart-strategy",
"{{.Site.BaseURL}}/{{.Site.LanguagePrefix}}/docs/ops/state/task_failure_recovery#fixed-delay-restart-strategy",
Copy link
Contributor

Choose a reason for hiding this comment

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

No other link seems to be using the LanguagePrefix, why should this one? Can we not use {{< ref "docs/.." >}} because the generated files are treated as short-codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for reviewing, @zentol! LanguagePrefix is used here because we think it's better to let the links in the Chinese version direct to the page in the Chinese version, rather than the English version. With LanguagePrefix the link will be like https://ci.apache.org/projects/flink/flink-docs-master/zh/docs/....

I've tried {{< ref "docs/.." >}}, but it doesn't works. The error message is: unexpected "<" in command. I'm not sure whether ref is available for the static html or not.

Here's something I found that may be helpful: https://discourse.gohugo.io/t/using-shortcodes-in-html-content/2960/5

@zentol zentol self-assigned this Aug 23, 2021
@zentol zentol merged commit 349f6f5 into apache:master Aug 23, 2021
@zentol
Copy link
Contributor

zentol commented Aug 23, 2021

@Thesharing can you also create a PR to fix the link in 1.13?

@Thesharing
Copy link
Contributor Author

Thesharing commented Aug 24, 2021

Thank you for helping me merge this PR, @zentol! The PR that backport the change to 1.13 is available now: #16725. Would you mind reviewing it if you got any free time?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants