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

Add: Extend conventional commits for dependency updates #771

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "Deps"
include: "scope"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "Deps"
include: "scope"

7 changes: 5 additions & 2 deletions pontos/changelog/conventional_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
{ message = "^remove", group = "Removed"},
{ message = "^change", group = "Changed"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^deps", group = "Dependencies"},
]
"""

Expand All @@ -59,8 +60,10 @@ class ChangelogBuilder:
from pontos.changelog import ChangelogBuilder

builder = ChangelogBuilder(space="my-org", project="my-project)
changelog = builder.create_changelog
last_version="1.2.3", next_version="2.0.0")
changelog = builder.create_changelog(
last_version="1.2.3",
next_version="2.0.0",
)
"""

def __init__(
Expand Down
6 changes: 5 additions & 1 deletion tests/changelog/test_conventional_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ChangelogBuilderTestCase(unittest.TestCase):
maxDiff = None

@patch("pontos.changelog.conventional_commits.Git", autospec=True)
def test_changelog_builder(self, git_mock: MagicMock):
def test_changelog_builder_with_config(self, git_mock: MagicMock):
today = datetime.today().strftime("%Y-%m-%d")

own_path = Path(__file__).absolute().parent
Expand Down Expand Up @@ -360,6 +360,7 @@ def test_changelog_builder_with_default_changelog_config(
"dead901 Refactor: bar baz ref",
"fedcba8 Fix: bar baz fixing",
"d0c4d0c Doc: bar baz documenting",
"a1c5a0b Deps: Update foo from 1.2.3 to 3.2.1",
]

changelog_builder = ChangelogBuilder(
Expand All @@ -381,6 +382,9 @@ def test_changelog_builder_with_default_changelog_config(
## Bug Fixes
* bar baz fixing [fedcba8](https://github.com/foo/bar/commit/fedcba8)

## Dependencies
* Update foo from 1.2.3 to 3.2.1 [a1c5a0b](https://github.com/foo/bar/commit/a1c5a0b)

[0.0.2]: https://github.com/foo/bar/compare/v0.0.1...v0.0.2"""

changelog = changelog_builder.create_changelog(
Expand Down