Skip to content

Conversation

@davidfirst
Copy link
Member

Fixes the issue where bit env unset incorrectly reported "successfully removed .bitmap env configuration" even when there was no env config in .bitmap to remove (e.g., after tagging a component).

Changes

  • Modified removeSpecificComponentConfig to return a boolean indicating whether something was actually removed
  • Modified ComponentConfigFile.removeAspect to return a boolean indicating whether something was removed
  • Updated unsetEnvFromComponents to track whether any config was actually removed from .bitmap and only mark components as "changed" if something was removed
  • Added e2e test that reproduces the issue: creates a component, sets env, tags it (which moves env to model), then verifies bit env unset shows the correct message

Test Plan

  • Added e2e test in e2e/harmony/env.e2e.ts that verifies the correct behavior
  • Test passes with the fix
Copilot AI review requested due to automatic review settings December 5, 2025 15:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an inaccurate success message shown by bit env unset when no env configuration exists in .bitmap to remove (e.g., after a component has been tagged and its config moved to the model).

Key changes:

  • Modified config removal methods to return boolean indicators of whether removal actually occurred
  • Updated unsetEnvFromComponents to track actual removals and only mark components as changed when config was removed
  • Added e2e test to verify correct behavior after tagging

Reviewed changes

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

File Description
scopes/workspace/workspace/workspace.ts Modified removeSpecificComponentConfig to return boolean and unsetEnvFromComponents to track actual removals, only writing config files and marking components as changed when something was actually removed
scopes/workspace/workspace/component-config-file/component-config-file.ts Updated removeAspect to return boolean indicating whether an aspect was actually removed
e2e/harmony/env.e2e.ts Added test case verifying that bit env unset shows correct message when no env config exists in .bitmap after tagging

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

@davidfirst davidfirst merged commit 86fa387 into master Dec 5, 2025
12 checks passed
@davidfirst davidfirst deleted the fix-env-unset-message branch December 5, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants