Skip to content

Add python to allowed script extensions#43467

Merged
cdcme merged 2 commits into
mainfrom
fix-43334-glob-support-python
Apr 13, 2026
Merged

Add python to allowed script extensions#43467
cdcme merged 2 commits into
mainfrom
fix-43334-glob-support-python

Conversation

@cdcme

@cdcme cdcme commented Apr 13, 2026

Copy link
Copy Markdown
Member

Fixes #43334

Summary by CodeRabbit

  • New Features

    • GitOps run-script handling now accepts Python (.py) files alongside shell and PowerShell, so glob-expanded script lists will include Python scripts.
  • Tests

    • Added a test validating glob filtering to ensure only supported script extensions (shell, PowerShell, Python) are returned and non-script files are excluded.

@cdcme cdcme marked this pull request as ready for review April 13, 2026 17:00
@cdcme cdcme requested a review from a team as a code owner April 13, 2026 17:00
Copilot AI review requested due to automatic review settings April 13, 2026 17:00

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

sgress454
sgress454 previously approved these changes Apr 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Python scripts to the set of allowed script file extensions for GitOps script resolution, addressing #43334.

Changes:

  • Allow .py in allowedScriptExtensions.
  • Update TestResolveScriptPaths to include a Python script file and expect it to be resolved.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/spec/gitops.go Adds .py to the allowed script extensions map used by resolveScriptPaths.
pkg/spec/gitops_test.go Extends the script resolution test to include a .py file and adjusts expectations.

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

Comment thread pkg/spec/gitops_test.go
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ff3a5c97-846a-48ab-99cc-b42ea0b0a70a

📥 Commits

Reviewing files that changed from the base of the PR and between 4445409 and 3ffca14.

📒 Files selected for processing (1)
  • pkg/spec/gitops_test.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/spec/gitops_test.go

Walkthrough

The GitOps script-extension whitelist was extended to include .py in allowedScriptExtensions (pkg/spec/gitops.go). Tests were updated (pkg/spec/gitops_test.go) with a new subtest that creates files .sh, .ps1, .py, and .txt, runs resolveScriptPaths with a glob, and asserts only .sh, .ps1, and .py are returned (three results) while .txt is excluded.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal but links to issue #43334, which provides context. However, it does not follow the detailed template structure with proper sections and checklists. Expand the description to follow the template structure, including relevant sections like 'Changes file added', 'Added/updated automated tests', and any other applicable checklist items.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Python to the list of allowed script extensions in the GitOps configuration.
Linked Issues check ✅ Passed The code changes add .py file extension support to GitOps script globbing, enabling Python scripts to be targeted via glob patterns as required in issue #43334.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the requirement: extending script extension whitelist to include Python and adding corresponding test coverage.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-43334-glob-support-python

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.

@codecov

codecov Bot commented Apr 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.91%. Comparing base (98e08ad) to head (3ffca14).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #43467      +/-   ##
==========================================
- Coverage   66.91%   66.91%   -0.01%     
==========================================
  Files        2596     2596              
  Lines      208103   208103              
  Branches     9321     9321              
==========================================
- Hits       139248   139244       -4     
- Misses      56199    56202       +3     
- Partials    12656    12657       +1     
Flag Coverage Δ
backend 68.69% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


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

@cdcme cdcme merged commit ce21d91 into main Apr 13, 2026
56 of 58 checks passed
@cdcme cdcme deleted the fix-43334-glob-support-python branch April 13, 2026 18:46
cdcme added a commit that referenced this pull request Apr 13, 2026
cdcme added a commit that referenced this pull request Apr 13, 2026
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.

Add glob pattern support for python scripts

3 participants