Skip to content

[RQ-885] fix: Fix global environment variable creation in local workspaces#4533

Merged
ajinkya-browserstack merged 1 commit intomasterfrom
RQ-885-global-env-fix
Mar 18, 2026
Merged

[RQ-885] fix: Fix global environment variable creation in local workspaces#4533
ajinkya-browserstack merged 1 commit intomasterfrom
RQ-885-global-env-fix

Conversation

@ajinkya-browserstack
Copy link
Contributor

@ajinkya-browserstack ajinkya-browserstack commented Mar 17, 2026

Closes issue:

📜 Summary of changes:

🎥 Demo Video:

Video/Demo:

✅ Checklist:

  • Make sure linting and unit tests pass.
  • No install/build warnings introduced.
  • Verified UI in browser.
  • For UI changes, added/updated analytics events (if applicable).
  • For changes in extension's code, manually tested in Chrome and Firefox.
  • Added/updated unit tests for this change.
  • Raised pull request to update corresponding documentation (if already exists).
  • Added demo video showing the changes in action (if applicable).

🧪 Test instructions:

🔗 Other references:

Summary by CodeRabbit

Release Notes

  • Chores
    • Improved internal handling of environment configuration management for better consistency and reliability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

Walkthrough

This change modifies the useVariableScopeAdapter.ts file to dynamically obtain the global environment ID by calling getGlobalEnvironmentId() instead of using a static GLOBAL_ENVIRONMENT_ID constant when updating the global environment save path. The modification affects only the save path logic with no changes to control flow or exported signatures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete; it contains only the template placeholder text with no actual content, missing all required information like issue link, summary, demo, and test instructions. Fill in the PR description with actual content: link the GitHub issue, summarize the changes, provide test instructions, and explain why no demo is needed if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the issue (RQ-885) and describes the main fix: global environment variable creation in local workspaces.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch RQ-885-global-env-fix
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/componentsV2/CodeEditor/components/EditorV2/components/VariablePopOver/hooks/useVariableScopeAdapter.ts (1)

5-5: ⚠️ Potential issue | 🟡 Minor

Remove unused import GLOBAL_ENVIRONMENT_ID.

After the change to use getGlobalEnvironmentId(), the GLOBAL_ENVIRONMENT_ID constant is no longer referenced in this file.

🧹 Proposed fix
-import { GLOBAL_ENVIRONMENT_ID, RUNTIME_VARIABLES_ENTITY_ID } from "features/apiClient/slices/common/constants";
+import { RUNTIME_VARIABLES_ENTITY_ID } from "features/apiClient/slices/common/constants";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/componentsV2/CodeEditor/components/EditorV2/components/VariablePopOver/hooks/useVariableScopeAdapter.ts`
at line 5, Remove the now-unused import GLOBAL_ENVIRONMENT_ID from the import
list in useVariableScopeAdapter.ts since the code switched to using
getGlobalEnvironmentId(); update the import statement so it only imports
RUNTIME_VARIABLES_ENTITY_ID (and any other still-used symbols) and ensure
getGlobalEnvironmentId() is used where GLOBAL_ENVIRONMENT_ID previously was
referenced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@app/src/componentsV2/CodeEditor/components/EditorV2/components/VariablePopOver/hooks/useVariableScopeAdapter.ts`:
- Line 5: Remove the now-unused import GLOBAL_ENVIRONMENT_ID from the import
list in useVariableScopeAdapter.ts since the code switched to using
getGlobalEnvironmentId(); update the import statement so it only imports
RUNTIME_VARIABLES_ENTITY_ID (and any other still-used symbols) and ensure
getGlobalEnvironmentId() is used where GLOBAL_ENVIRONMENT_ID previously was
referenced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3593566-3dc4-4b76-ae48-5b1c5d15b846

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec2c99 and 12e5ba6.

📒 Files selected for processing (1)
  • app/src/componentsV2/CodeEditor/components/EditorV2/components/VariablePopOver/hooks/useVariableScopeAdapter.ts

@ajinkya-browserstack ajinkya-browserstack merged commit fb7f7cb into master Mar 18, 2026
2 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