Skip to content

fix(mergedeep): handle null actor_id in bypass actor comparison#1035

Open
tdabasinskas wants to merge 2 commits into
github-community-projects:main-enterprisefrom
datolabs-io:fix/null-actor-id-diff
Open

fix(mergedeep): handle null actor_id in bypass actor comparison#1035
tdabasinskas wants to merge 2 commits into
github-community-projects:main-enterprisefrom
datolabs-io:fix/null-actor-id-diff

Conversation

@tdabasinskas

Copy link
Copy Markdown

Fixes #1034.

GitHub ignores actor_id for certain bypass actor types (OrganizationAdmin, DeployKey) and always returns null. Previously, the merge logic would fail to converge because it couldn't properly identify these actors when comparing config to live state.

Changes:

  • Add actor_type to IDENTITY_FIELDS for proper actor differentiation
  • Skip null-valued identity fields when finding the primary identifier
  • Update sample config to use null actor_id for OrganizationAdmin
  • Add test coverage for null actor_id scenarios

GitHub ignores actor_id for certain bypass actor types (OrganizationAdmin, DeployKey) and always returns null. Previously, the merge logic would fail to converge because it couldn't properly identify these actors when comparing config to live state.

Changes:
- Add actor_type to IDENTITY_FIELDS for proper actor differentiation
- Skip null-valued identity fields when finding the primary identifier
- Update sample config to use null actor_id for OrganizationAdmin
- Add test coverage for null actor_id scenarios
Copilot AI review requested due to automatic review settings July 24, 2026 06:03

Copilot AI 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.

Pull request overview

This pull request fixes non-converging ruleset bypass_actors diffs when GitHub returns actor_id: null for certain actor types (notably OrganizationAdmin and DeployKey), by improving identity selection during deep comparison so config-to-live matching works correctly.

Changes:

  • Adds actor_type to the identity-field scan and skips null identity values so compareDeep can match bypass_actors even when actor_id is null.
  • Updates the sample settings to document actor_id: null for OrganizationAdmin.
  • Adds unit tests covering the null actor_id bypass-actor scenario (with a recommended extension to also cover DeployKey).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/mergeDeep.js Updates identity selection logic used by deep comparison for object-array matching.
test/unit/lib/mergeDeep.test.js Adds regression tests for bypass_actors entries where actor_id is null.
docs/sample-settings/settings.yml Updates sample ruleset configuration to use actor_id: null for OrganizationAdmin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/mergeDeep.js
Comment thread test/unit/lib/mergeDeep.test.js
Add test case to verify that bypass actors with null `actor_id` but different `actor_type` values (e.g., OrganizationAdmin vs DeployKey) are correctly distinguished during comparison.

This ensures the fix for null actor_id comparison properly handles multiple actor types with null IDs.

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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.

Bypass actors with actor_id: null are invisible to ruleset diffs; actor_id: 1 re-applies forever

2 participants