Skip to content

feat(webex): skip records with unresolved references - #457

Merged
pthmas merged 5 commits into
mainfrom
feat/webex-skip-unresolved-references
Dec 3, 2026
Merged

pthmas merged 5 commits into
mainfrom
feat/webex-skip-unresolved-references

Conversation

@pthmas

@pthmas pthmas commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A Webex mapping can reference records of an earlier mapping that its filters removed, for example a workspace whose locationId points to a location filtered out of the LocationSite mapping. A scalar reference is passed to the destination without a check, so the Infrahub destination stops the run because it cannot find the peer. The only workarounds today are lists of excluded IDs in the config, or a parent resource that sends one workspaces request per location.

Change

New opt-in Webex resource option skip_unresolved_references (default false). When it is on, after filters and transforms:

  • a record whose single reference matches no loaded record of the referenced mapping is dropped;
  • in a list reference, only the unresolved items are removed and the record is kept;
  • empty reference values are left as they are;
  • the referenced mapping must load first (order), or the adapter raises a ValueError;
  • each mapping that loses records or list items logs one warning with the counts and up to 20 unresolved values.

The change is limited to the Webex adapter, its tests, its docs page and a changelog fragment.

Testing

  • Webex adapter tests: 46 passed. Full test suite: 417 passed, 6 skipped.
  • Ruff, ty, yamllint and pylint on the changed Webex files pass.
  • Tested against a Webex organization and a local Infrahub: all workspaces were read in one request, rooms in filtered-out locations were skipped with a warning, and a second run found no differences.

View guided diff Turn on auto-fix

@pthmas
pthmas requested a review from a team as a code owner November 27, 2026 08:17
@pthmas
pthmas requested review from iddocohen and removed request for a team November 27, 2026 08:17
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Deploying infrahub-sync with  Cloudflare Pages  Cloudflare Pages

Latest commit: c708e6f
Status: ✅  Deploy successful!
Preview URL: https://57fdcbaa.infrahub-sync.pages.dev
Branch Preview URL: https://feat-webex-skip-unresolved-r.infrahub-sync.pages.dev

View logs

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/docs/adapters/webex.mdx Resolved
- Point the load-order error and docs at the computed order; explicit order is optional.
- Do not check references from a mapping to itself.
- Copy only the dicts along a rewritten list path instead of deep-copying every record.
- Log dict references without an id as the whole dict.
- Document that scalar list references need the option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pthmas pthmas added the changes/minor Bump minor version (new feature) label Nov 27, 2026

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread infrahub_sync/adapters/webex.py Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iddocohen

Copy link
Copy Markdown

@pthmas I have nothing further on this one and all checks pass. The cubic comment on infrahub_sync/adapters/webex.py:209 about self-references is still open: do you want to address it first, or should I approve?

A self-reference cannot be checked while its mapping is loading, so passing
it through let a reference to a filtered-out record reach the destination.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@iddocohen iddocohen 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.

I verified that the adapter rejects self-references and ran all 49 Webex adapter tests at this commit. All 20 GitHub checks passed or were skipped.

@pthmas
pthmas merged commit dbb5c03 into main Dec 3, 2026
20 checks passed
@pthmas
pthmas deleted the feat/webex-skip-unresolved-references branch December 3, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes/minor Bump minor version (new feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants