Skip to content

Add bundler component-renaming conflict check (P-040) - #412

Merged
hdamker merged 4 commits into
camaraproject:mainfrom
hdamker:feat/p040-bundler-renaming-conflict
Aug 7, 2026
Merged

Add bundler component-renaming conflict check (P-040)#412
hdamker merged 4 commits into
camaraproject:mainfrom
hdamker:feat/p040-bundler-renaming-conflict

Conversation

@hdamker

@hdamker hdamker commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

enhancement/feature
tests

What this PR does / why we need it:

Adds a validation check that catches, at PR time, the defect Redocly's bundler already detects but currently hides: two components sharing a name with different content, where the bundler silently renames the externally-referenced one to <Name>-2. P-040 runs redocly bundle --component-renaming-conflicts-severity=error and reports on a genuine conflict; a same-name-same-content proxy component is never flagged. Warns on draft/alpha/rc, errors at public.

Confirmed live in QualityOnDemand (#589), WebRTC (#199), and DeviceLocation — all currently pre-public, so this doesn't retroactively block anyone on merge.

Which issue(s) this PR fixes:

Fixes #411

Special notes for reviewers:

Local checks run:

  • python3 -m pytest validation/tests/test_python_checks_bundling.py -q
  • python3 -m pytest validation/tests/test_rule_metadata_integrity.py -q
  • python3 -m pytest validation/tests -q (1231 passed)

The regression-canary fixture for this rule isn't captured yet — regression_runner.py can only test what's already published to validation-framework. Will follow up once this merges.

Changelog input

release-note
Adds a component-renaming-conflict check (P-040) that catches a same-name-different-content collision between a local component and one pulled in via an external $ref during bundling.

Additional documentation

This section can be blank.

docs

@hdamker
hdamker requested review from Kevsy and rartych as code owners August 6, 2026 10:26
@hdamker hdamker added this to the v0.9.0 milestone Aug 6, 2026
rartych
rartych previously approved these changes Aug 6, 2026

@rartych rartych left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

GitHub Actions' runner made redocly force-color its bundle output, and
a reset code landing between the location token and "at" broke
_CONFLICT_RE's \s+, so the check silently found nothing there. No CLI
flag exists to suppress this (checked --help and the CLI source); the
underlying color library's own env-var detection proved inconsistent
in local testing, so strip ANSI in our own code instead. Adds a
regression test using the exact colored output captured from CI.
@hdamker
hdamker force-pushed the feat/p040-bundler-renaming-conflict branch from c926064 to e4c98bd Compare August 6, 2026 11:14
@rartych
rartych self-requested a review August 6, 2026 11:45
rartych
rartych previously approved these changes Aug 6, 2026
Kevsy
Kevsy previously approved these changes Aug 6, 2026

@Kevsy Kevsy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

A real-runner reconstruction showed NO_COLOR alone (no ANSI-stripping)
satisfies the unmodified conflict regex against redocly's colored output —
the same mechanism already verified for 047's illegible bundling-failure
annotation. Simplifies the check to one suppression path instead of two.
@hdamker
hdamker dismissed stale reviews from Kevsy and rartych via d3a6e12 August 6, 2026 16:14
@hdamker

hdamker commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

GitHub is currently reporting an incident with Actions and I can't test the simplification done in d3a6e12. Setting the PR for the moment to draft until the test on my fork is done.

@hdamker
hdamker marked this pull request as draft August 6, 2026 16:25
@hdamker
hdamker marked this pull request as ready for review August 7, 2026 05:13
@hdamker

hdamker commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

GH back in business ... could test P-040 firing in a real validation run on hdamker/TestRepo-QoD.

@hdamker
hdamker requested review from Kevsy and rartych August 7, 2026 05:15
…enaming-conflict

# Conflicts:
#	validation/engines/python_checks/__init__.py
#	validation/rules/python-rules.yaml
#	validation/tests/test_rule_metadata_integrity.py
@hdamker

hdamker commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Merging based on the previous approvals.

@hdamker
hdamker merged commit 772931f into camaraproject:main Aug 7, 2026
8 checks passed
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.

Detect component-renaming collisions from bundling during validation

3 participants