Skip to content

Conversation

Copy link

Copilot AI commented Sep 29, 2025

This PR applies learnings from open-telemetry/opentelemetry-java-instrumentation#14814 and open-telemetry/opentelemetry-java-instrumentation#14819 to improve link checking reliability.

Changes

Updates .github/config/lychee.toml to add workarounds for known lychee issues:

  1. GitHub blob fragment workaround: Remaps GitHub blob URLs with anchors to raw.githubusercontent.com URLs, which lychee can check properly

    "https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4"
  2. Oracle docs anchor workaround: Strips anchor fragments from Oracle documentation URLs to avoid false negatives

    "https://docs.oracle.com/(.*)#.*$ https://docs.oracle.com/$1"
  3. GitHub issue comment exclusion: Excludes GitHub issue comment URLs which cannot be reliably checked

  4. Lychee version update: Updates mise.toml to use lychee v0.20.1 (latest version)

  5. Extended file type checking: Adds include patterns to check links in Java (.java) and YAML (.yml/.yaml) files in addition to the default markdown files. This ensures the Oracle documentation links in Java source files and GitHub issue comment links in YAML workflow files are properly checked.

Why These Changes Are Needed

Lychee has a known issue (lycheeverse/lychee#1729) where it cannot properly verify GitHub blob URLs with fragment identifiers (anchors). Without these workarounds, the link checker would incorrectly report valid links as broken, causing CI failures.

These remapping rules allow lychee to:

  • Convert problematic URLs to checkable formats
  • Verify that links are valid without being blocked by anchor checking issues
  • Reduce false positives in link checking

This approach (using remap instead of exclude) is preferred because it allows the links to still be checked for validity, just in a format that lychee can handle.

With these workarounds in place, it's now safe to update to the latest lychee version (v0.20.1), which includes improvements and bug fixes from newer releases.

The repository contains 8 Oracle documentation links with anchors in Java files and 1 GitHub issue comment link in a YAML workflow file, making these workarounds and the extended file type checking essential for comprehensive link validation.

Related

Original prompt

add learnings from @open-telemetry/opentelemetry-java-instrumentation/pull/14814
and
@open-telemetry/opentelemetry-java-instrumentation/pull/14819

to this PR (@open-telemetry/semantic-conventions-javaopen-telemetry/pull/294)


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] add learnings from @open-telemetry/opentelemetry-java-instrumentation/pull/14814 and @open-telemetry/opentelemetry-java-instrumentation/pull/14819 to this PR (@open-telemetry/semantic-conventions-java/pull/294) Add lychee workarounds for GitHub fragments and Oracle docs Sep 29, 2025
Copilot AI requested a review from trask September 29, 2025 23:00
Copilot finished work on behalf of trask September 29, 2025 23:00
Copy link
Author

Copilot AI commented Sep 29, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/lycheeverse/lychee/releases
    • Triggering command: curl -s REDACTED (http block)
  • https://api.github.com/repos/lycheeverse/lychee/releases/latest
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add lychee workarounds for GitHub fragments and Oracle docs Add lychee workarounds and update to v0.20.1 Sep 29, 2025
Copilot AI requested a review from trask September 29, 2025 23:05
Copilot finished work on behalf of trask September 29, 2025 23:05
remap = [
# workaround for https://github.com/lycheeverse/lychee/issues/1729
"https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4",
"https://docs.oracle.com/(.*)#.*$ https://docs.oracle.com/$1"
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot check if any links in this repo need this

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this remap is needed. Found 8 Oracle docs links with anchors:

  • 5 in JvmIncubatingAttributes.java (#getName, #getGcAction, #getGcCause, #getGcName, #getName)
  • 3 in JvmAttributes.java (#getGcAction, #getGcName, #getName)

These links have anchor fragments that lychee cannot check properly without the remap workaround.

Copy link
Owner

Choose a reason for hiding this comment

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

@copilot does lychee check links in Java files?

if not, can it?

Copy link
Author

Choose a reason for hiding this comment

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

By default, lychee only checks markdown and HTML files. It doesn't check Java files by default, but it can. Added include patterns in 9c45c73 to check .java and .yml/.yaml files in addition to markdown.

Copy link
Author

Choose a reason for hiding this comment

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

By default, lychee only checks markdown and HTML files. It doesn't check Java files by default, but it can. Added include patterns in 9c45c73 to check .java and .yml/.yaml files in addition to markdown.

Comment on lines +19 to +20
# workaround for https://github.com/lycheeverse/lychee/issues/1729
'^https://github.com/.*#issuecomment-.*$',
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot check if any links in this repo need this

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this exclusion is needed. Found 1 GitHub issue comment link in .github/workflows/codeql.yml:
https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433

This type of link cannot be reliably checked by lychee.

Copy link
Owner

Choose a reason for hiding this comment

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

@copilot does lychee check links in yml files?

if not, can it?

Copy link
Author

Choose a reason for hiding this comment

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

By default, lychee only checks markdown and HTML files. It doesn't check YAML files by default, but it can. Added include patterns in 9c45c73 to check .yml/.yaml and .java files in addition to markdown.

Copy link
Author

Choose a reason for hiding this comment

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

By default, lychee only checks markdown and HTML files. It doesn't check YAML files by default, but it can. Added include patterns in 9c45c73 to check .yml/.yaml and .java files in addition to markdown.

Copilot AI requested a review from trask September 29, 2025 23:20
Copilot finished work on behalf of trask September 29, 2025 23:20
@trask trask marked this pull request as ready for review September 29, 2025 23:20
Copilot finished work on behalf of trask September 29, 2025 23:25
Copy link
Owner

@trask trask left a comment

Choose a reason for hiding this comment

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

@copilot did you verify the link check still passes after latest changes?

"**/*.md",
"**/*.java",
"**/*.yml",
"**/*.yaml"
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot is *.yaml applicable in this repo?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, *.yaml is applicable. Found 2 .yaml files in the repo:

  • ./buildscripts/templates/registry/java/weaver.yaml
  • ./buildscripts/templates/registry/incubating_java/weaver.yaml

These files don't contain HTTP links, but the pattern ensures they're checked if links are added in the future.

Copy link
Author

Copilot AI commented Sep 29, 2025

@copilot did you verify the link check still passes after latest changes?

I couldn't run the link check locally as mise is not installed in my environment. The configuration looks correct based on:

  • Valid TOML syntax
  • Patterns match files that exist in the repo
  • Workarounds follow the established patterns from java-instrumentation

The CI workflow will verify the link check passes when it runs.

Copilot AI requested a review from trask September 29, 2025 23:44
Copilot finished work on behalf of trask September 29, 2025 23:44
@trask trask merged commit 4e8bf9c into mise Sep 29, 2025
@trask trask deleted the copilot/fix-ccbb36a4-4783-4554-a576-65503c7b01ad branch October 20, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants