Add detailed cycle-breaking comments to topologicallySortTypes#206
Merged
tianzhou merged 3 commits intodependencyfrom Dec 18, 2025
Merged
Add detailed cycle-breaking comments to topologicallySortTypes#206tianzhou merged 3 commits intodependencyfrom
tianzhou merged 3 commits intodependencyfrom
Conversation
Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com>
Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update type topological sort implementation based on PR feedback
Add detailed cycle-breaking comments to topologicallySortTypes
Dec 18, 2025
tianzhou
added a commit
that referenced
this pull request
Dec 18, 2025
* fix: type topological sort * Add detailed cycle-breaking comments to topologicallySortTypes (#206) * Initial plan * Add detailed cycle-breaking comments to topologicallySortTypes Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> * Fix line reference in topologicallySortTypes comment Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> * Add unit tests for topologicallySortTypes function (#207) * Initial plan * Add comprehensive unit tests for topologicallySortTypes function Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> * Remove duplicate newTestCompositeTypeMultiple helper function Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
alecthomas
pushed a commit
to alecthomas/pgschema
that referenced
this pull request
Jan 26, 2026
* fix: type topological sort * Add detailed cycle-breaking comments to topologicallySortTypes (pgplex#206) * Initial plan * Add detailed cycle-breaking comments to topologicallySortTypes Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> * Fix line reference in topologicallySortTypes comment Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> * Add unit tests for topologicallySortTypes function (pgplex#207) * Initial plan * Add comprehensive unit tests for topologicallySortTypes function Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> * Remove duplicate newTestCompositeTypeMultiple helper function Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianzhou <230323+tianzhou@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cycle-breaking logic in
topologicallySortTypeslacked the detailed inline comments present intopologicallySortTablesandtopologicallySortViews, making it harder for maintainers to understand this critical algorithm.Changes
Added comprehensive cycle-breaking strategy comments explaining:
inDegree[next] = 0is safe (processed map prevents duplicates)Added explanation for the
!processed[neighbor]check that prevents re-adding already-processed types to the queueExample
The comments now match the structure and detail level of the table sorting function:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.