Skip to content

Fix --relatives bug to generate distinct org_ids per relative - #172

Merged
jhutar merged 3 commits into
mainfrom
fix-relatives-orgid-generation
Jul 23, 2026
Merged

jhutar merged 3 commits into
mainfrom
fix-relatives-orgid-generation

Conversation

@hyp3rion31gr3y

Copy link
Copy Markdown
Contributor

The _get_relatives() method was incorrectly creating the same org_id for all relatives by calling self._get_account() once outside the loop and reusing the value. This caused all hosts to be associated with the same organization regardless of the --relatives parameter value.

Fixed by moving self._get_account() calls inside the list comprehension so each relative gets a unique org_id, enabling proper multi-tenant performance testing scenarios.

The _get_relatives() method was incorrectly creating the same org_id
for all relatives by calling self._get_account() once outside the loop
and reusing the value. This caused all hosts to be associated with the
same organization regardless of the --relatives parameter value.

Fixed by moving self._get_account() calls inside the list comprehension
so each relative gets a unique org_id, enabling proper multi-tenant
performance testing scenarios.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
{
"account": common_acc_orgid,
"orgid": common_acc_orgid,
"account": self._get_account(),

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.

This way "account" and "orgid" will be different. I do not see a problem with current code.

Rajaditya Chauhan and others added 2 commits July 23, 2026 11:55
Calling _get_account() twice per relative could mismatch account and
org_id; generate once and reuse so multi-tenant host distribution works.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 38c7b497-a0ee-4532-902d-c5da8e8773ce

📥 Commits

Reviewing files that changed from the base of the PR and between 17c7735 and 8edc320.

📒 Files selected for processing (1)
  • extras/opl/generators/inventory_ingress.py

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved inventory data generation when account-specific data is unavailable.
    • Each related entry now receives distinct account and organization details, along with unique satellite identifiers.

Walkthrough

The inventory ingress generator now creates a separate account, organization ID, satellite ID, and satellite instance ID for each relative when account data is absent.

Changes

Inventory relative generation

Layer / File(s) Summary
Generate per-relative identifiers
extras/opl/generators/inventory_ingress.py
_get_relatives calls _get_account() separately for each relative and generates fresh satellite identifiers instead of reusing one account/organization pair.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the fix to generate distinct org_ids for each relative.
Description check ✅ Passed The description matches the change by explaining the unique org_id generation per relative.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jhutar

jhutar commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Thank you!

@jhutar
jhutar merged commit 6bd2dad into main Jul 23, 2026
6 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.

2 participants