Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename AIRBYTE_ALLOW_CUSTOM_CODE to AIRBYTE_ENABLE_UNSAFE_CODE #415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bnchrch
Copy link
Contributor

@bnchrch bnchrch commented Mar 12, 2025

What

  • The PR addresses a comment from AJ Steers regarding environment variable consistency.
  • It renames the environment variable used to enable unsafe code (AIRBYTE_ALLOW_CUSTOM_CODE) to AIRBYTE_ENABLE_UNSAFE_CODE.

How

  • Updated the environment variable name for clarity and consistency.
  • Ensured that the variable matches the one in the source declarative manifest.

Additional Context

  • This change was prompted by a discussion in a different PR.
  • Aims to improve alignment between platform and manifest settings.

Notes for Reviewer

  • Review the changes to ensure the new variable name is correctly implemented.
  • Confirm that the new name aligns with the declarative manifest requirements.

Recommended Reading Order

  • Review the comments from AJ Steers on the original PR.
  • Examine the changes made in this PR for context.

Can This PR Be Reverted and Rolled Back

  • Yes, if any issues arise, this PR can be reverted by restoring the previous variable name.

Summary by CodeRabbit

  • Documentation
    • Updated error messages and user instructions to reference the new configuration setting for custom code execution.
  • Chores
    • Renamed the environment variable to improve clarity without impacting functionality.

@Copilot Copilot bot review requested due to automatic review settings March 12, 2025 18:14
@github-actions github-actions bot added the chore label Mar 12, 2025

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 updates the environment variable used to control custom code execution for improved clarity and consistency with the declarative manifest. The change renames the environment variable value from "AIRBYTE_ALLOW_CUSTOM_CODE" to "AIRBYTE_ENABLE_UNSAFE_CODE".

  • Updated the environment variable value in both the constant assignment and error message.
  • Adjusted the documentation string to match the new environment variable name.
Comments suppressed due to low confidence (1)

airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py:22

  • [nitpick] Consider renaming the constant to something like ENV_VAR_ENABLE_UNSAFE_CODE so it fully reflects the updated environment variable name.
ENV_VAR_ALLOW_CUSTOM_CODE = "AIRBYTE_ENABLE_UNSAFE_CODE"
Copy link
Contributor

coderabbitai bot commented Mar 12, 2025

📝 Walkthrough

Walkthrough

The change updates the environment variable controlling custom code execution. In the file, references to the variable have been modified from "AIRBYTE_ALLOW_CUSTOM_CODE" to "AIRBYTE_ENABLE_UNSAFE_CODE". This update affects the variable declaration, the error message in the custom code error class, and the documentation string in the custom code checking function. The underlying logic of checking against the value 'true' remains unchanged.

Changes

File(s) Change Summary
airbyte_cdk/.../custom_code_compiler.py Renamed the environment variable from "AIRBYTE_ALLOW_CUSTOM_CODE" to "AIRBYTE_ENABLE_UNSAFE_CODE" across the declaration, error message, and docstring.

Would you like any additional details or a sequence diagram, or is this summary sufficient for your needs? wdyt?

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py (1)

22-22: Consider renaming the constant to match its new value?

The constant name ENV_VAR_ALLOW_CUSTOM_CODE now contains the value "AIRBYTE_ENABLE_UNSAFE_CODE", creating a slight mismatch between the name (using "ALLOW") and the value (using "ENABLE_UNSAFE").

Perhaps renaming this constant to ENV_VAR_ENABLE_UNSAFE_CODE would provide better naming consistency, wdyt?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 545e2ac and b68cc00.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
🔇 Additional comments (3)
airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py (3)

38-38: Error message update looks good!

The error message has been correctly updated to reference the new environment variable name, which ensures users receive the right instructions.


58-58: Documentation update looks good!

The function documentation has been properly updated to reference the new environment variable name, maintaining consistency with the implementation change.


60-60:

❓ Verification inconclusive

Verify this line works with the renamed environment variable

This line hasn't been modified, but it uses the constant whose value has changed. The code will now check for AIRBYTE_ENABLE_UNSAFE_CODE instead of AIRBYTE_ALLOW_CUSTOM_CODE.

It would be good to verify that all dependent systems/documentation are updated to use the new environment variable name to avoid confusion.


🏁 Script executed:

#!/bin/bash
# Search for other occurrences of the old environment variable name in the codebase
rg "AIRBYTE_ALLOW_CUSTOM_CODE" --type py

Length of output: 40


Ensure all documentation and dependent systems align with the new environment variable usage

It appears that no remaining occurrences of the old environment variable AIRBYTE_ALLOW_CUSTOM_CODE were found in the Python codebase. However, could you please double-check that all dependent systems, configuration files, and documentation have been updated to reference the new environment variable AIRBYTE_ENABLE_UNSAFE_CODE? Also, confirm that the constant ENV_VAR_ALLOW_CUSTOM_CODE is now correctly set to use the new variable name. wdyt?

Copy link
Contributor

@aaronsteers aaronsteers left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants