Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 14, 2025

Fixed CI failures by updating only the link URLs in reference-style link definitions, changing from direct API URLs to xref syntax. The document content and structure remain unchanged - only the link destinations were updated to reference current (non-obsolete) types.

Changes Made

Documentation Fixes

  • docs/concepts/progress/progress.md: Updated link URLs to use xref while preserving structure
  • docs/concepts/elicitation/elicitation.md: Updated link URLs to use xref while preserving structure
  • docs/concepts/logging/logging.md: Updated link URLs to use xref while preserving structure
  • Preserved original document structure with reference-style links

DocFX CI Validation

  • Added --warningsAsErrors true flag to docfx command in Makefile to ensure warnings are treated as errors during documentation generation

Fixed Invalid xref Cross-References

  • ElicitAsync now references McpServer.ElicitAsync* instead of McpServerExtensions.ElicitAsync*
  • ElicitationHandler now references McpClientHandlers.ElicitationHandler instead of ElicitationCapability.ElicitationHandler
  • AsClientLoggerProvider now references McpServer.AsClientLoggerProvider* instead of McpServerExtensions.AsClientLoggerProvider*
  • SetLoggingLevel now references McpClient.SetLoggingLevel* instead of McpClientExtensions.SetLoggingLevel*
  • System.Progress<T> now uses a regular markdown link to learn.microsoft.com with correct syntax (xref doesn't work for this type in DocFX)

CI Improvements

  • Added emojis to CI workflow step names for better readability and visual distinction (📥 Clone, 🔧 Setup, 📦 Install/Pack, 🏗️ Build, 🧪 Test, 📚 Docs, 📤 Upload)

The xref syntax allows DocFX to validate references at build time and warn if referenced types are obsolete or missing. With the --warningsAsErrors flag, the build will now fail if any documentation warnings are encountered, preventing broken links from being merged.

Fixes #861

Original prompt

This section details on the original issue you should resolve

<issue_title>code in main, mainly in docs, are causing CI to fail in the "Check markdown links" leg. Can you take a look?</issue_title>
<issue_description>> code in main, mainly in docs, are causing CI to fail in the "Check markdown links" leg. Can you take a look?

It appears to be links pointing to the obsoleted interfaces (presumably docfx is not producing API docs for these). docfx supports <xref> tags that it resolves to API docs (and warns if it can't). We should update all markdown links to types in our docs to use xref tags.

Originally posted by @eiriktsarpalis in #860 (comment)
</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #861


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Fix CI issues by updating markdown links to xref tags Fix markdown links in docs by replacing obsolete API references with xref tags Oct 14, 2025
@Copilot Copilot AI requested a review from eiriktsarpalis October 14, 2025 05:48
Copilot finished work on behalf of eiriktsarpalis October 14, 2025 05:48
Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

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

@copilot only change the links please, document content or structure (e.g. lists) should remain faithful to the original.

Copy link
Contributor Author

Copilot AI commented Oct 14, 2025

@copilot only change the links please, document content or structure (e.g. lists) should remain faithful to the original.

Fixed in commit 5cd08ba. Reverted to the original document structure and only updated the link URLs themselves, preserving the reference-style link format at the end of each section.

@Copilot Copilot AI requested a review from eiriktsarpalis October 14, 2025 06:07
Copilot finished work on behalf of eiriktsarpalis October 14, 2025 06:07
Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

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

@copilot now update all docfx command line locations (the Makefile and gh-actions yml) so that the --warningAsErrors true flag is included.

Copy link
Contributor Author

Copilot AI commented Oct 14, 2025

@copilot now update all docfx command line locations (the Makefile and gh-actions yml) so that the --warningAsErrors true flag is included.

Added in commit 75feb45. The --warningsAsErrors true flag has been added to the docfx command in the Makefile's generate-docs target, which is used by the GitHub Actions workflow.

Copilot finished work on behalf of eiriktsarpalis October 14, 2025 06:15
@Copilot Copilot AI requested a review from eiriktsarpalis October 14, 2025 06:15
Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

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

@copilot now that I've added CI validation for doc generation, please fix the outstanding warnings in CI:

/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/elicitation/elicitation.md: warning UidNotFound: 2 invalid cross reference(s) "ModelContextProtocol.Server.McpServerExtensions.ElicitAsync*", "ModelContextProtocol.Protocol.ElicitationCapability.ElicitationHandler".
/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/elicitation/elicitation.md: Details for invalid cross reference(s): "ModelContextProtocol.Server.McpServerExtensions.ElicitAsync*" in line 14, "ModelContextProtocol.Protocol.ElicitationCapability.ElicitationHandler" in line 34
/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/logging/logging.md: warning UidNotFound: 2 invalid cross reference(s) "ModelContextProtocol.Server.McpServerExtensions.AsClientLoggerProvider*", "ModelContextProtocol.Client.McpClientExtensions.SetLoggingLevel*".
/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/logging/logging.md: Details for invalid cross reference(s): "ModelContextProtocol.Server.McpServerExtensions.AsClientLoggerProvider*" in line 62, "ModelContextProtocol.Client.McpClientExtensions.SetLoggingLevel*" in line 85
/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/progress/progress.md: warning UidNotFound: 1 invalid cross reference(s) "System.Progress`1".
/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/progress/progress.md: Details for invalid cross reference(s): "System.Progress`1" in line 60, "System.Progress`1" in line 62

Note that for System.Progress`1 specifically xref's don't work in docfx, instead you need to create a regular markdown link pointing to the learn.microsoft.com website for the corresponding type's API documentation.

Copy link
Contributor Author

Copilot AI commented Oct 14, 2025

@copilot now that I've added CI validation for doc generation, please fix the outstanding warnings in CI:

/Users/runner/work/csharp-sdk/csharp-sdk/docs/concepts/elicitation/elicitation.md: warning...

Fixed in commit eb25e5e. Updated all invalid xref cross-references to point to the correct types:

  • ElicitAsync: McpServer instead of McpServerExtensions
  • ElicitationHandler: McpClientHandlers instead of ElicitationCapability
  • AsClientLoggerProvider: McpServer instead of McpServerExtensions
  • SetLoggingLevel: McpClient instead of McpClientExtensions
  • System.Progress`1: Changed to regular markdown link to learn.microsoft.com as xref doesn't work for this type

@Copilot Copilot AI requested a review from eiriktsarpalis October 14, 2025 07:06
Copilot finished work on behalf of eiriktsarpalis October 14, 2025 07:06
@Copilot Copilot AI requested a review from eiriktsarpalis October 14, 2025 07:12
Copilot finished work on behalf of eiriktsarpalis October 14, 2025 07:12
@eiriktsarpalis eiriktsarpalis changed the title Fix markdown links in docs by replacing obsolete API references with xref tags Fix markdown links in docs and add docfx CI validation Oct 14, 2025
@eiriktsarpalis eiriktsarpalis marked this pull request as ready for review October 14, 2025 07:16
Copilot finished work on behalf of eiriktsarpalis October 14, 2025 09:51
@Copilot Copilot AI requested a review from eiriktsarpalis October 14, 2025 09:51
@eiriktsarpalis eiriktsarpalis merged commit b40f06c into main Oct 14, 2025
11 checks passed
@eiriktsarpalis eiriktsarpalis deleted the copilot/update-markdown-links-to-xref branch October 14, 2025 14:24
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.

code in main, mainly in docs, are causing CI to fail in the "Check markdown links" leg. Can you take a look?

3 participants