Skip to content

fix: append --filter to sync_cmd instead of diff_cmd in test_resource…#502

Merged
nathantournant merged 3 commits intomainfrom
fix/test-update-sync-filter-cmd
Apr 3, 2026
Merged

fix: append --filter to sync_cmd instead of diff_cmd in test_resource…#502
nathantournant merged 3 commits intomainfrom
fix/test-update-sync-filter-cmd

Conversation

@hazrac
Copy link
Copy Markdown
Contributor

@hazrac hazrac commented Mar 31, 2026

…_update_sync

In test_resource_update_sync, the --filter argument was appended to diff_cmd instead of sync_cmd due to a copy-paste error. This caused the sync step to run unfiltered in live integration tests (RECORD=none), potentially syncing resources outside the test scope. Cassette-based tests masked the issue since VCR replays fixed responses regardless.

Adds regression tests validating that command-building logic places filter arguments in the correct command lists.

Requirements for Contributing to this repository

  • Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • The pull request must only fix one issue, or add one feature, at the time.
  • The pull request must update the test suite to demonstrate the changed functionality.
  • After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see CONTRIBUTING.

What does this PR do?

Description of the Change

Alternate Designs

Possible Drawbacks

Verification Process

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@hazrac hazrac requested a review from a team as a code owner March 31, 2026 15:06
heyronhay
heyronhay previously approved these changes Mar 31, 2026
David Mitchell and others added 3 commits April 3, 2026 16:32
…_update_sync

In test_resource_update_sync, the --filter argument was appended to
diff_cmd instead of sync_cmd due to a copy-paste error. This caused
the sync step to run unfiltered in live integration tests (RECORD=none),
potentially syncing resources outside the test scope. Cassette-based
tests masked the issue since VCR replays fixed responses regardless.

Adds regression tests validating that command-building logic places
filter arguments in the correct command lists.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When syncing roles cross-DC, permissions gated behind feature flags
(e.g. bits_dev_write) may exist in the source org but not the
destination. Previously, remap_permissions left the unresolved
permission name as a raw string in the payload, causing the Roles API
to reject it with "invalid UUID [permission_name]".

Now, permissions that exist in the source but have no match in the
destination are dropped from the role payload with a warning log.
This prevents a single missing permission from breaking the entire
role sync — and by extension every integration test teardown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Notebooks API now injects ai_generated, ai_edited, and human_edited
tags on every write based on request characteristics. Since the sync CLI
uses API key auth (not MCP), every PUT is classified as a human edit,
causing human_edited:true to be added server-side. This creates a
non-converging diff because the source notebook lacks the tag while the
destination always gets it re-injected.

Strip these server-managed tags in handle_special_case_attr so they are
ignored on both sides during import, sync, and diff. Legitimate user
tags (team:*, llm-observability:*) are unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nathantournant nathantournant force-pushed the fix/test-update-sync-filter-cmd branch from cdfac01 to d56fb9a Compare April 3, 2026 16:33
@nathantournant
Copy link
Copy Markdown
Member

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Apr 3, 2026

View all feedbacks in Devflow UI.

2026-04-03 17:08:02 UTC ℹ️ Start processing command /merge


2026-04-03 17:08:07 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 2m (p90).


2026-04-03 19:08:21 UTCMergeQueue: The build pipeline has timeout

The merge request has been interrupted because the build 0 took longer than expected. The current limit for the base branch 'main' is 120 minutes.

@nathantournant nathantournant merged commit 224876d into main Apr 3, 2026
15 of 21 checks passed
@nathantournant nathantournant deleted the fix/test-update-sync-filter-cmd branch April 3, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants