Unknown Member Boolean Cast Fix#30
Merged
Merged
Conversation
Extracts version from dbt_project.yml on push to main, checks if the tag already exists, and creates a GitHub release with changelog notes. .... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code) Co-Authored-By: Cortex Code <noreply@snowflake.com>
Contributor
Reviewer's GuideAdds a GitHub Actions workflow that, on pushes to main or manual dispatch, reads the dbt project version, checks for an existing git tag, extracts the corresponding changelog section, and creates a GitHub release using the GitHub CLI if the tag does not yet exist. Sequence diagram for the new GitHub release workflowsequenceDiagram
actor Developer
participant GitHubActions as GitHub_Actions_Workflow
participant Git as git_repo
participant Python as python_scripts
participant GHCLI as gh_cli
Developer->>GitHub_Actions_Workflow: push to main or workflow_dispatch
GitHub_Actions_Workflow->>GitHub_Actions_Workflow: actions/checkout
GitHub_Actions_Workflow->>Python: Extract version from dbt_project.yml
Python-->>GitHub_Actions_Workflow: version output
GitHub_Actions_Workflow->>Git: git rev-parse --verify refs/tags/version
alt tag exists
Git-->>GitHub_Actions_Workflow: tag found
GitHub_Actions_Workflow->>GitHub_Actions_Workflow: skip Extract changelog for this version
GitHub_Actions_Workflow->>GitHub_Actions_Workflow: skip Create GitHub release
else tag does not exist
Git-->>GitHub_Actions_Workflow: tag not found
GitHub_Actions_Workflow->>Python: Extract changelog for this version
Python-->>GitHub_Actions_Workflow: title and /tmp/release_notes.md
GitHub_Actions_Workflow->>GHCLI: gh release create version
GHCLI-->>GitHub_Actions_Workflow: GitHub release created
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The
Extract version from dbt_project.ymlstep assumes PyYAML is installed (import yaml), which is not guaranteed on GitHub-hosted runners; consider either adding an explicit installation step or parsing the version with a tool that’s already available (e.g.,yqor simplegrep/sed). - In the changelog extraction step, if the requested version header is missing from
CHANGELOG.mdthe script will silently produce an empty title/notes; it would be safer to detect this case and fail the workflow with a clear error message rather than creating a release with incomplete metadata.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `Extract version from dbt_project.yml` step assumes PyYAML is installed (`import yaml`), which is not guaranteed on GitHub-hosted runners; consider either adding an explicit installation step or parsing the version with a tool that’s already available (e.g., `yq` or simple `grep/sed`).
- In the changelog extraction step, if the requested version header is missing from `CHANGELOG.md` the script will silently produce an empty title/notes; it would be safer to detect this case and fail the workflow with a clear error message rather than creating a release with incomplete metadata.
## Individual Comments
### Comment 1
<location path=".github/workflows/release.yml" line_range="21-26" />
<code_context>
+ with:
+ fetch-depth: 0
+
+ - name: Extract version from dbt_project.yml
+ id: version
+ run: |
+ VERSION=$(python3 -c "import yaml; print(yaml.safe_load(open('dbt_project.yml'))['version'])")
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+ echo "Detected version: $VERSION"
+
+ - name: Check if tag already exists
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid relying on an uninstalled PyYAML dependency on the runner
This step imports `yaml`, which depends on PyYAML and is not installed by default on `ubuntu-latest`, so the workflow can fail unless another step installs it. To make this more robust, either use a tool already available on the runner (e.g., `yq`, `grep`, `sed`) to read `dbt_project.yml`, or add an explicit step to install PyYAML before running this command.
</issue_to_address>
### Comment 2
<location path=".github/workflows/release.yml" line_range="39-48" />
<code_context>
+ - name: Extract changelog for this version
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Fail fast when the changelog entry for the version is missing
If `CHANGELOG.md` lacks a header for the detected version, this step will still succeed and produce an empty `TITLE`/release notes, resulting in a release with incomplete metadata. Consider checking `found == False` (or an empty `title`) and exiting with a non-zero status so the workflow fails when the changelog is not updated.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- Replace python3 yaml import with grep/sed to extract version from dbt_project.yml (PyYAML not guaranteed on ubuntu-latest runners) - Add error check if version extraction fails - Fail workflow with clear error if CHANGELOG.md has no entry for the detected version instead of silently creating an empty release .... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code) Co-Authored-By: Cortex Code <noreply@snowflake.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unknown_membermacro: added explicit::booleancasts foris_current,is_deleted, and generic boolean columns to ensure correct type inference in Snowflake when generating unknown member rows.