Skip to content

Resolve synonym dependencies and fix SQL parser compatibility - #62

Merged
cangelosilima merged 3 commits into
mainfrom
codex/synonym-lineage-parser-fixes
Sep 26, 2026
Merged

cangelosilima merged 3 commits into
mainfrom
codex/synonym-lineage-parser-fixes

Conversation

@cangelosilima

@cangelosilima cangelosilima commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Synonym definitions were extracted without target dependencies, so consumers did not contribute to the underlying object's usage or column lineage. Oracle rejected CREATE OR REPLACE EDITIONABLE SYNONYM, SQL Server's current grammar rejected legacy statements such as RAISERROR @errno @errmsg, and database-link connection definitions produced unnecessary lineage parser warnings.

This change:

  • Collects SQL Server and Oracle synonym targets, preserving schema, database, and linked-server/database-link qualifiers.
  • Retains consumer → synonym relationships and adds consumer → underlying target dependencies and column usage. Resolves chains while stopping at cycles or unresolved targets.
  • Supports Oracle EDITIONABLE/NONEDITIONABLE synonyms and regenerates the checked-in parser with ANTLR 4.13.1. The large generated diff is parser state/ATN renumbering.
  • Retries failed SQL Server parsing with the legacy grammar only when the entire script parses cleanly; otherwise retains the modern partial AST.
  • Skips database-link DDL in lineage parsing while preserving connection metadata and consumer/link/remote-object relationships. This does not repair malformed exported DDL.
  • Includes catalog object IDs in Oracle and SQL Server parser warnings, with SQL Server line/column diagnostics.

Updated with main through df278c4, including the merged Oracle extraction fix from PR #61.

Validation: all repository pre-push checks passed. Release CLI tests: 966 passed, 21 existing skips; CLI coverage: 100% lines, branches, methods, and full methods. Site formatting, lint, and type checking passed; site tests: 534 passed, 1 existing skip, with 100% coverage. Regression cases cover synonym chains, cycles, missing targets, qualified names, column usage, legacy SQL, database-link parsing exclusion, and diagnostic source IDs.

Rebuild the catalog with the updated CLI to populate these relationships. Live verification against the reported databases remains pending. The photographed extraneous input 'null' warnings still require the affected SQL for diagnosis; they are not claimed as fixed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8366309ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +453 to +455
if (ResolveSynonymTarget(targetId, nodesById, synonymTargets) is { } underlyingId && underlyingId != targetId)
{
AddEdge(node.Id, underlyingId, dynamic);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Expand synonyms reached through linked servers

When a consumer references an extracted synonym through a linked server or Oracle database link, resolution enters the ViaLink branch and continues at line 418 before this expansion runs. As a result, the consumer never receives the promised dependency on the synonym's ultimate target, and any columns collected under (consumer, underlyingTarget) are discarded because that edge does not exist. Apply the synonym-target expansion to resolved linked targets before leaving that branch.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T05:58:38.100485Z c836630 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Quality results

Quality gate: success
Commit: 10dfb64aa68e7393eba753440e8d031f34055a35 · View run and reports

Check Result
Dependency vulnerabilities success
CodeQL success
CLI lint and format success
CLI tests and coverage success
CLI performance budgets success
Site lint and format success
Site tests and coverage success
Workflow lint success
Coverage badge data success
Line coverage Measured Minimum
CLI 100% 100%
Site 100% 80%

CLI line, branch, method, and full method coverage must each reach 100%. A missing report is shown as unavailable. See the linked run for test failures, detailed CLI/Site coverage summaries and HTML reports, and scanner results.

@cangelosilima
cangelosilima merged commit c2960c4 into main Sep 26, 2026
26 of 27 checks passed
@cangelosilima
cangelosilima deleted the codex/synonym-lineage-parser-fixes branch September 26, 2026 08:27
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.

1 participant