Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Oct 15, 2025

Summary

Add a changed: bool field to InjectGlobalVariablesReturn to track whether the AST was modified during the global variable injection transformation.

  • Adds changed field to InjectGlobalVariablesReturn struct
  • Tracks changes via consolidated mark_as_changed() helper method
  • Updates replace_dot_defines when dot define replacements occur
  • Updates inject_imports when import statements are injected
  • Updates build method to return changed in all paths

This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation.

Test plan

  • All existing tests pass
  • No new tests needed - change tracking is straightforward

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings October 15, 2025 06:34
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 15, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Oct 15, 2025
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

Adds a changed flag to track whether the AST was modified during the inject_global_variables transformation, enabling callers to detect modifications without diffing the AST.

  • Add changed: bool to InjectGlobalVariablesReturn and pipeline state
  • Set changed when imports are injected and when dot-define member expressions are replaced
  • Return changed from build in all code paths

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Boshen Boshen force-pushed the feat/inject-global-variables-changed-field branch from bd10f2b to 67c13e3 Compare October 15, 2025 06:36
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 15, 2025
Copy link
Member Author

Boshen commented Oct 15, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Oct 15, 2025
…Return (#14618)

## Summary

Add a `changed: bool` field to `InjectGlobalVariablesReturn` to track whether the AST was modified during the global variable injection transformation.

- Adds `changed` field to `InjectGlobalVariablesReturn` struct
- Tracks changes via consolidated `mark_as_changed()` helper method
- Updates `replace_dot_defines` when dot define replacements occur
- Updates `inject_imports` when import statements are injected
- Updates `build` method to return `changed` in all paths

This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation.

## Test plan

- [x] All existing tests pass
- [x] No new tests needed - change tracking is straightforward

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the feat/inject-global-variables-changed-field branch from 67c13e3 to 6daf3c2 Compare October 15, 2025 06:43
…Return (#14618)

## Summary

Add a `changed: bool` field to `InjectGlobalVariablesReturn` to track whether the AST was modified during the global variable injection transformation.

- Adds `changed` field to `InjectGlobalVariablesReturn` struct
- Tracks changes via consolidated `mark_as_changed()` helper method
- Updates `replace_dot_defines` when dot define replacements occur
- Updates `inject_imports` when import statements are injected
- Updates `build` method to return `changed` in all paths

This allows callers to efficiently determine if injections or replacements were made without needing to compare the AST before and after transformation.

## Test plan

- [x] All existing tests pass
- [x] No new tests needed - change tracking is straightforward

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the feat/inject-global-variables-changed-field branch from 6daf3c2 to 2f85b31 Compare October 15, 2025 06:46
@graphite-app graphite-app bot merged commit 2f85b31 into main Oct 15, 2025
20 checks passed
@graphite-app graphite-app bot deleted the feat/inject-global-variables-changed-field branch October 15, 2025 06:53
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants