Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] Fix a few issues with infinite recursions if the content contains cyclic curation #905

Merged

Conversation

d-ronnqvist
Copy link
Contributor

  • Explanation: This fixes two crashes and a few minor related issues that can happen in some cases when building documentation that has cyclic curation.
  • Scope: Crashes (infinitely recursing until the the process runs out of stack) when building documentation with some cases of cyclic curation.
  • Issue: rdar://126974763
  • Risk: Low.
  • Testing: Added automated tests for both crashes. Manually tested with the project where these issues were originally found.
  • Reviewer: @mayaepps @patshaughnessy
  • Original PR: Fix a few issues with infinite recursions if the content contains cyclic curation #898

…lic curation (apple#898)

* Add functions to operate on directed graphs

* Update topic graph to use sequences for graph traversal

* Avoid computing full paths to determine if a symbol is manually curated

* Fix an infinite recursion determining the paths to a node when there's cyclic curation

rdar://126974763

* Avoid computing all paths when the caller only needs the shortest path

* Avoid computing all paths when the caller only needs the roots/leaves

* Avoid computing all paths when the caller only needs know if a certain node is encountered

* Avoid computing all paths when the caller only needs to visit each reachable node once

* Rename 'pathsTo(_:options:)' to 'finitePaths(to:options:)

* Fix another infinite recursion when pages are curated in cycles

rdar://126974763

* Fix correctness issue where symbol has two auto curated parents

* Address code review feedback:
- Rename neighbors parameter to edges for DirectedGraph initializer
- Rename GraphPathIterator and move it to DirectedGraph+Paths file
- Add convenience properties for topic graph directed graph "views
- Elaborate on breadcrumbs path documentation and implementation comments
- Elaborate on graph cycle documentation with concrete examples
- Fix missing edge in directed graph test data
- Use preconditionFailure for topic graph node that should always exist
- Add additional graph cycle tests

* Explicitly exit (trap) if trying to dump a topic graph with cyclic paths
@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 8d071cc into apple:release/6.0 May 3, 2024
2 checks passed
@d-ronnqvist d-ronnqvist deleted the fix-infinite-recursions-6.0 branch May 3, 2024 13:40
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.

None yet

2 participants