Skip to content

Relax test for language prefix in the links #8161

@Andygol

Description

@Andygol

What happened?

The test https://github.com/open-telemetry/opentelemetry.io/actions/runs/18612491468/workflow?pr=5891#L136 failed due to strict conditions for evaluating the log level.

WARN  File /home/runner/work/opentelemetry.io/opentelemetry.io/content/uk/community/_index.md: drop unnecessary '/uk/' prefix from /uk/community/marketing-guidelines/
WARN  File /home/runner/work/opentelemetry.io/opentelemetry.io/content/uk/community/_index.md: drop unnecessary '/uk/' prefix from /uk/site/

See https://github.com/open-telemetry/opentelemetry.io/actions/runs/18612491468/job/53072630692?pr=5891#step:5:10 ☝️

What did you expect would happen?

I expect that this level of logs should be passed or have less critical level for assessment.

What is the name + path of the page where you encountered the issue?

{{ if and (hasPrefix $url $langPathPrefix) .Page.File -}}
{{ warnf "File %s: drop unnecessary '%s' prefix from %s"
.Page.File.Filename $langPathPrefix $url -}}

and

scripts/check-build-log.sh

Possible options to avoid the test fails

Since the links in the footer are outside the scope of the render-links decorator for automatically adding a language code prefix, you have to add it manually for the corresponding links in site.param.links (See lines 136-147 in the hugo.yaml). However, at the same time, the logic for checking for the presence of language code in the decorator also works for links in the footer, which leads to a warning. To solve the issue quickly, you can use one of these suggestions:

  • Add exceptions to the .warnings-skip-list.txt file for the specific warnings, or
  • Use fmt.Warnidf with INFO ID in render-link.html#L46 and add ignoreLogs: [INFO] into hugo.yaml to suppress this type of log messages.

However, a more reliable way to solve the issue would probably be to add an exception for footer links to the decorator's link checking logic.

I eagerly await a decision on possible ways to resolve this issue.

Tip:
React
with 👍 to help prioritize this issue. Please use comments to provide useful
context, avoiding +1 or me too, to help us triage it. Learn more
here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI/infraCI & infrastructurebugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions