Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/release-note-generation/split_release_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ def create_changelog_entry(current_date: str, module: LibraryModule,
changelog_entry += '### Features\n\n'
for line in changelog_lines:
changelog_entry += f'* {line}\n'
changelog_entry += '\n'
if dependency_changes:
changelog_entry += "\n### Dependencies\n\n"
changelog_entry += "### Dependencies\n\n"
for line in dependency_changes:
changelog_entry += f'* {line}\n'

if len(changelog_lines) == 0 and len(dependency_changes) == 0:
changelog_entry += '* No change\n'
return changelog_entry


Expand Down
26 changes: 25 additions & 1 deletion .github/release-note-generation/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
class TestCase(unittest.TestCase):

def test_create_changelog_entry(self):
# do something
entry = create_changelog_entry(
'2023-06-10',
dummy_module,
Expand All @@ -34,6 +33,31 @@ def test_create_changelog_entry(self):
* update google-cloud-shared-dependencies to 1.2.3
''')

def test_create_changelog_entry_only_deps(self):
entry = create_changelog_entry(
'2023-06-10',
dummy_module,
[],
['update google-cloud-shared-dependencies to 1.2.3']
)
self.assertEqual(entry, f'''## 1.2.3 (2023-06-10)

### Dependencies

* update google-cloud-shared-dependencies to 1.2.3
''')

def test_create_changelog_entry_empty(self):
entry = create_changelog_entry(
'2023-06-10',
dummy_module,
[],
[]
)
self.assertEqual(entry, f'''## 1.2.3 (2023-06-10)

* No change

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the effect of this pull request.

''')

def test_group_changes_by_api(self):
main_changes = [
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/changelog_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The fetch-depth default 1 seems enough. No need to fetch all branches.
https://github.com/actions/checkout#checkout-a-different-branch

ref: ${{ github.head_ref }}
- name: Show status of the branch checked out
run: |
Expand All @@ -40,7 +39,7 @@ jobs:
python3 .github/release-note-generation/split_release_note.py pr_body.txt .
- name: Commit the change and push to the pull request branch
run: |
git config user.email "yoshi-code-bot[bot]@users.noreply.github.com"
git config user.email "yoshi-code-bot@users.noreply.github.com"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is another fix on this pull request. It was failing CLA check in a3412ef. I confirmed this email address passes the CLA check e539052.

git config user.name "yoshi-code-bot"
git remote set-url origin https://x-access-token:${{ secrets.YOSHI_CODE_BOT_TOKEN }}@github.com/${{ github.repository }}
git add ./*/CHANGELOG.md
Expand Down