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

Enhance sdk-changelog commands #4040

Merged
merged 60 commits into from
Feb 14, 2024
Merged

Enhance sdk-changelog commands #4040

merged 60 commits into from
Feb 14, 2024

Conversation

GuyAfik
Copy link
Contributor

@GuyAfik GuyAfik commented Feb 12, 2024

Related Issues

related: https://jira-dc.paloaltonetworks.com/browse/CIAC-9581

Description

  • Added support for the sdk-changelog --init command automatically detect the pull request number.
  • Add PR comment with the changelog markdown on every change.

Tests:

  • test when changelog was not changed or added between two last commits (no comment on the PR: 8acdd4c)
  • test when changelog has been changed between two last commits: (there is a comment on the PR: 57396d6)
  • test when changelog does not exist at all (should fail on validate) - 17be450
  • test when changelog was added between two last commits - should comment on the PR (c9a363a)

@coveralls
Copy link
Collaborator

coveralls commented Feb 12, 2024

Pull Request Test Coverage Report for Build 6aaf28fc-51d6-44ae-849e-9eb74299a1dc

Details

  • 28 of 45 (62.22%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 80.942%

Changes Missing Coverage Covered Lines Changed/Added Lines %
demisto_sdk/commands/common/git_util.py 7 8 87.5%
demisto_sdk/scripts/changelog/changelog.py 21 37 56.76%
Totals Coverage Status
Change from base Build 85e84e51-453b-4b0d-8e44-7af2166e3a6e: -0.007%
Covered Lines: 36607
Relevant Lines: 45226

💛 - Coveralls

Copy link

Your changelog in markdown :)
:None

Copy link

Changelog(s) in markdown:
just a test for markdown

Copy link

Changelog(s) in markdown:

  • just a test for markdown, its a new feature for argument test #4040

Copy link

Changelog(s) in markdown:

  • just a test for markdown, its a new feature for argument test #4040
  • just a test for markdown-2, its a new feature for argument test #4040

@GuyAfik GuyAfik changed the title Enhance sdk changelog init Enhance sdk-changelog commands Feb 13, 2024
Copy link

Changelog(s) in markdown:

  • Added a new step in the validate-changelog to comment the changelog description in PR comments. #4040
  • Added support to query the pull request number automaticlly when running sdk-changelog --init command. #4040

@GuyAfik GuyAfik marked this pull request as ready for review February 13, 2024 12:36
Copy link

Changelog(s) in markdown:

  • Added a new step in the validate-changelog to comment the changelog description in PR comments. #4040
  • Added support to query the pull request number automaticlly when running sdk-changelog --init command.. #4040

Copy link

Changelog(s) in markdown:

  • Added a new step in the validate-changelog to comment the changelog description in PR comments. #4040
  • Added support to query the pull request number automaticlly when running sdk-changelog --init command. #4040

@@ -36,6 +36,14 @@ jobs:
run: |
echo "Validating changelog for PR: $PR_NUMBER with Name: $PR_TITLE"
poetry run python ./Utils/github_workflow_scripts/changelog_validation_scripts/validate_changelog.py -n "$PR_NUMBER" -t "$PR_TITLE"
- name: Comment Changelog In PR Description
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider making this run only if the changelog validation passed (needs: validate-changelog) instead of continue-on-error

Copy link
Contributor Author

@GuyAfik GuyAfik Feb 13, 2024

Choose a reason for hiding this comment

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

wdym? it already runs only if validate was successful. (its like the behaivor you described, needs: validate-changelog)
I didn't see a reason to fail the whole job in case the comment step didn't work, that's why i use continue_on_error only on the last step.

demisto_sdk/commands/common/git_util.py Outdated Show resolved Hide resolved
demisto_sdk/commands/common/git_util.py Outdated Show resolved Hide resolved
@GuyAfik GuyAfik requested a review from dorschw February 13, 2024 16:02
Copy link
Contributor

@ilaner ilaner left a comment

Choose a reason for hiding this comment

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

nice job!

Copy link

Changelog(s) in markdown:

  • Added a new step in the validate-changelog to comment the changelog description in PR comments. #4040
  • Added support to query the pull request number automatically when running sdk-changelog --init command. #4040

@GuyAfik GuyAfik merged commit 116f567 into master Feb 14, 2024
33 checks passed
@GuyAfik GuyAfik deleted the enhance_sdk_changelog_init branch February 14, 2024 09:16
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.

4 participants