-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Release note #31
base: main
Are you sure you want to change the base?
Changes from 6 commits
67b3f07
b504ec3
ccc0400
5092fe6
5696d62
d016b62
319317d
adde2cb
db86a28
2aa57d5
5dbc6a3
5edf0bf
ef62226
12678d6
15ddd01
c6aba60
23f92bc
3dbc058
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: | ||
- breaking-change | ||
- title: New Features 🎉 | ||
labels: | ||
- enhancement | ||
- feat | ||
- kind:feat | ||
- feature | ||
- title: Bug fixes 🐛 | ||
labels: | ||
- fix | ||
- kind:fix | ||
- title: Documentation 📄 | ||
labels: | ||
- documentation | ||
- title: Other Changes | ||
labels: | ||
- '*' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code patch adds a changelog configuration, likely for a tool like Here's a code review: Strengths:
Potential Issues/Improvements:
Bug Risks: The primary risk is unexpected behavior due to label conflicts or edge cases not explicitly handled in the configuration. Testing with various label combinations is crucial. Suggested Improvements:
In summary, the patch is a good start, but adding more robust error handling and clarifying ambiguous points will significantly improve its reliability and usability. Thorough testing is essential. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Create release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Release pushed tag | ||
runs-on: ubuntu-22.04 | ||
env: | ||
VERSION: ${{ github.ref_name }} | ||
LINK: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }} | ||
RECEIVE_ID_TYPE: 'email' | ||
RECEIVE_ID: '[email protected]' | ||
steps: | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref_name }} | ||
run: | | ||
gh release create "$tag" \ | ||
--repo="$GITHUB_REPOSITORY" \ | ||
--title="${tag#v}" \ | ||
--generate-notes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This GitHub Actions workflow creates a GitHub release for each tag matching the Strengths:
Weaknesses and Improvement Suggestions:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
release_result=$(gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${tag#v}" \
--generate-notes)
if [ $? -ne 0 ]; then
echo "Error creating release: $release_result"
exit 1
fi
Bug Risks:
Improved Workflow (incorporating suggestions): name: Create release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Release pushed tag
runs-on: ubuntu-22.04
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
echo "Creating release for tag: $tag"
release_result=$(gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="Release ${tag#v}" \
--generate-notes)
if [ $? -ne 0 ]; then
echo "Error creating release: $release_result"
exit 1
fi
echo "Release created successfully!" This improved version includes better error handling and more informative logging. Remember to adjust the release title generation as needed to match your desired naming conventions. Consider adding pre-release handling if necessary. |
||
- name: New release | ||
runs-on: ubuntu-22.04 # Or another suitable runner | ||
container: lesanpi/lark-release-version-card | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This GitHub Actions workflow creates a GitHub release when a tag starting with 'v' is pushed. Here's a code review: Bug Risks and Potential Improvements:
Revised Workflow (incorporating some improvements): name: Create release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Release pushed tag
runs-on: ubuntu-22.04
env:
VERSION: ${{ github.ref_name }}
TAG: ${{ github.ref_name }} # Renamed for clarity
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Consider a dedicated PAT
run: |
gh release create "$TAG" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ github.ref_name | replace: 'v', '' }}" \
--generate-notes || exit 1 # Added error handling
- name: Update Version Card (Explain Purpose Here!) # Added comment for clarity
runs-on: ubuntu-22.04
container: lesanpi/lark-release-version-card
# Consider adding env variables or inputs here to pass data from the first step. This revised version addresses some of the concerns. Remember to replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This GitHub Actions workflow creates a GitHub release when a tag matching Bug Risks and Potential Issues:
Improvement Suggestions:
Revised Workflow (incorporating some suggestions): name: Create Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-22.04
env:
VERSION: ${{ github.ref_name }}
LINK: https://github.com/${{ github.event.repository }}/releases/tag/${{ github.ref_name }}
steps:
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="${{ github.event.repository }}" \
--title="${{ github.ref_name#v }}" \
--generate-notes || exit 1 # Add error handling
- name: Update Version Card (Explain Purpose Here)
uses: actions/checkout@v3 # Check out code if needed by container
container: lesanpi/lark-release-version-card
# Add environment variables or inputs for the container
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref_name }} Remember to replace the placeholder comment in the "Update Version Card" step with a clear explanation of its functionality. This revised workflow addresses some of the key risks and incorporates improvements for better readability and maintainability. However, a more complete solution might require a more sophisticated approach to error handling, tag parsing, and possibly the use of a more robust method for managing secrets. |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code patch adds a changelog configuration, likely for a tool that automatically generates changelogs based on Git commits and issue labels. The configuration is well-structured and uses clear category titles and label selectors.
Potential Bug Risks & Improvements:
Label Overlap: The biggest risk is unintentional overlap between label categories. For example, a commit could have both
enhancement
andbreaking-change
labels. The configuration doesn't define precedence; the commit might appear in multiple sections. Consider adding a mechanism to handle conflicting labels, perhaps prioritizingbreaking-change
over others. This might involve a custom sorting or filtering step in the changelog generation process.Wildcard Handling (
*
): TheOther Changes
category uses a wildcard (*
). While convenient, this is a potential catch-all that could obscure important changes not covered by other categories. It's best practice to be explicit. Consider reviewing your label set to ensure all relevant labels are explicitly assigned to categories.Missing
kind
Label Handling: Thekind
labels (kind:fix
,kind:feat
) are included but might not be sufficient if your team uses additionalkind
labels. It might be useful to either explicitly list all possiblekind
labels or consider a more flexible approach that handles unknownkind
labels appropriately.Label Case Sensitivity: The configuration doesn't specify whether label matching is case-sensitive. Ensure consistency across your team regarding label capitalization to prevent commits from being accidentally omitted from the changelog. Explicitly handle case-insensitivity in your changelog generation tool if it's not default behavior.
No Error Handling: The configuration doesn't define behavior when a commit doesn't have any of the specified labels. This might lead to commits being dropped entirely or falling into the wildcard category by default. Consider a default category or logging mechanism to handle uncategorized commits.
Missing Scope for Breaking Changes: Breaking changes should ideally include a concise scope describing what part of the system was affected. While not directly part of this configuration, encourage your team to use a consistent convention (e.g.,
BREAKING CHANGE: <Scope>: <Description>
) in commit messages.Improvement Suggestions:
Add comments: Add comments explaining the rationale behind each category and label selection. This will improve maintainability and understanding for others.
Consider a more structured format (e.g., YAML): While the current format is readable, a structured format like YAML would improve readability and make it easier to manage as the configuration grows. This would allow for easier validation and processing.
Overall, the patch is a good starting point, but requires further refinement to handle edge cases and ensure accuracy in changelog generation. Addressing the potential risks outlined above will improve the robustness and reliability of the changelog process.