Skip to content

Deepak/path filter include#209

Open
k-marian-deepak wants to merge 19 commits intosidpalas:mainfrom
k-marian-deepak:Deepak/path-filter-include
Open

Deepak/path filter include#209
k-marian-deepak wants to merge 19 commits intosidpalas:mainfrom
k-marian-deepak:Deepak/path-filter-include

Conversation

@k-marian-deepak
Copy link
Copy Markdown

@k-marian-deepak k-marian-deepak commented Apr 17, 2026

A hands on for the Trigger Event for a specific type of file.

Copilot AI review requested due to automatic review settings April 17, 2026 03:47
Copy link
Copy Markdown

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 updates several GitHub Actions workflow examples (triggers/filters, jobs/steps, step types) and adds Devbox virtualenv/Poetry hook scripts to support local developer environment setup.

Changes:

  • Adjusted the triggers/filters workflow (including a commented schedule example) and path filtering for PR events.
  • Expanded the jobs/steps workflow by adding new jobs and new needs dependencies.
  • Added Devbox hook scripts for Python venv creation/validation and Poetry environment selection.

Reviewed changes

Copilot reviewed 2 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
03-core-features/filters/excluded-file.txt Listed as part of the PR’s changed files (intended as an example artifact for path filtering).
.github/workflows/03-core-features--04-triggers-and-filters.yaml Updates PR path filters and tweaks the commented schedule example formatting.
.github/workflows/03-core-features--03-workflows-jobs-steps.yaml Adds new jobs and dependencies to demonstrate job relationships in a workflow DAG.
.github/workflows/03-core-features--02-step-types.yaml Updates example output strings for inline bash/python and action input text.
.devbox/virtenv/python312/bin/venvShellHook.sh Introduces a shell hook to validate/create a Python venv and handle non-Devbox venvs.
.devbox/virtenv/poetry/bin/initHook.sh Adds a Poetry init hook to select the Python interpreter for a given pyproject directory.

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

### https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
# schedule:
# - cron: "0 0 * * *" # Midnight UTC
# - cron: "0 0 * * *" # Midnight UTC
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The commented schedule example is mis-indented: # - cron: ... is shown under # schedule: with extra indentation, so if someone uncomments it they’ll end up with invalid YAML. Adjust the comment indentation to match the actual structure (e.g., keep the - cron aligned under schedule:).

Suggested change
# - cron: "0 0 * * *" # Midnight UTC
# - cron: "0 0 * * *" # Midnight UTC

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
#!/bin/sh
set -eu
STATE_FILE="$DEVBOX_PROJECT_ROOT/.devbox/venv_check_completed"
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

PR description focuses on path filters/triggers, but this PR also introduces Devbox virtualenv/Poetry hook scripts and modifies other workflow examples. Consider updating the PR description to reflect the broader scope or splitting these unrelated changes into separate PRs to keep review/rollback safer.

Copilot uses AI. Check for mistakes.
needs:
- job-1
- job-2
- job-5 # a new job to explore the realtion and working of the jobs in a workflow
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

Typo in the inline comment: realtion should be relation.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to 10
needs:
- job-5 # a new job to explore the realtion and working of the jobs in a workflow
steps:
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

job-5 is described as “independent”/able to run in parallel, but job-1 and job-3 now both need job-5, which makes it a prerequisite and changes the DAG/parallelism. Either drop the needs: [job-5] dependencies (if the goal is parallelism) or update the job description/comments to match the intended dependency behavior.

Copilot uses AI. Check for mistakes.

create_venv() {
python -m venv "$VENV_DIR" --clear
echo "*\n.*" >> "$VENV_DIR/.gitignore"
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

echo "*\n.*" >> "$VENV_DIR/.gitignore" won’t reliably create a two-line .gitignore in POSIX sh (many echo implementations don’t interpret \n), and >> will append duplicates across runs. Use a portable approach (e.g., printf with real newlines) and overwrite the file rather than appending.

Suggested change
echo "*\n.*" >> "$VENV_DIR/.gitignore"
printf '%s\n' '*' '.*' > "$VENV_DIR/.gitignore"

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,3 @@
#!/bin/sh

poetry env use $(command -v python) --directory="${DEVBOX_PYPROJECT_DIR:-$DEVBOX_DEFAULT_PYPROJECT_DIR}" --no-interaction --quiet >&2
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

--directory=... is a Poetry global option and typically must appear before the subcommand (e.g., poetry --directory ... env use ...). As written, poetry env use ... --directory=... may be ignored or error depending on Poetry version. Reorder the command to ensure it consistently targets the intended pyproject directory.

Suggested change
poetry env use $(command -v python) --directory="${DEVBOX_PYPROJECT_DIR:-$DEVBOX_DEFAULT_PYPROJECT_DIR}" --no-interaction --quiet >&2
poetry --directory="${DEVBOX_PYPROJECT_DIR:-$DEVBOX_DEFAULT_PYPROJECT_DIR}" env use $(command -v python) --no-interaction --quiet >&2

Copilot uses AI. Check for mistakes.
job-1:
runs-on: ubuntu-24.04
needs:
- job-5 # a new job to explore the realtion and working of the jobs in a workflow
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

Typo in the inline comment: realtion should be relation.

Copilot uses AI. Check for mistakes.
jobs:
job-1:
runs-on: ubuntu-24.04
needs:
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

There’s trailing whitespace after the needs: key (needs: ). This can trip YAML linters and makes diffs noisy; remove the extra space so it’s just needs:.

Suggested change
needs:
needs:

Copilot uses AI. Check for mistakes.
- run: echo "This is a second step in the new job of this workflow"

# By Deepak
job-6:
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

There’s trailing whitespace after the job id key (job-6: ). Removing it avoids whitespace-only diffs and potential YAML lint failures.

Suggested change
job-6:
job-6:

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +37
echo "Do you want to overwrite it? (y/n)"
read reply
echo
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

This hook prompts with read reply when the venv isn’t a Devbox venv. If this hook runs in a non-interactive context (e.g., devbox run / CI), it will block indefinitely. Consider detecting non-interactive stdin (or honoring an env var default) and failing fast or choosing a safe default behavior.

Suggested change
echo "Do you want to overwrite it? (y/n)"
read reply
echo
if [ "${DEVBOX_VENV_OVERWRITE:-}" != "" ]; then
reply="$DEVBOX_VENV_OVERWRITE"
elif [ -t 0 ]; then
echo "Do you want to overwrite it? (y/n)"
read reply
echo
else
echo "ERROR: Non-interactive shell cannot prompt to overwrite $VENV_DIR."
echo "Set DEVBOX_VENV_OVERWRITE=y to overwrite it, or DEVBOX_VENV_OVERWRITE=n to keep it."
exit 1
fi

Copilot uses AI. Check for mistakes.
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