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

Ensure PR number is referenced in .unreleased files #5740

Merged
merged 1 commit into from
Jun 2, 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
1 change: 1 addition & 0 deletions .github/workflows/changelog-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
shell: bash --norc --noprofile {0}
env:
BODY: ${{ github.event.pull_request.body }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
folder=".unreleased"

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This release includes these noteworthy features:

**Features**
* #5212 Allow pushdown of reference table joins
* #5221 Improve Realtime Continuous Aggregate performance
* #5261 Improve Realtime Continuous Aggregate performance
* #5252 Improve unique constraint support on compressed hypertables
* #5339 Support UPDATE/DELETE on compressed hypertables
* #5344 Enable JOINS for Hierarchical Continuous Aggregates
Expand Down
9 changes: 9 additions & 0 deletions scripts/check_changelog_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import sys
import re
import os


# Check if a line matches any of the specified patterns
Expand All @@ -17,13 +18,21 @@ def main():
# Get the file name from the command line argument
if len(sys.argv) > 1:
file_name = sys.argv[1]
pr_number_seen = False
pr_num_str = f'#{os.environ["PR_NUMBER"]} '
# Read the file and check non-empty lines
with open(file_name, "r", encoding="utf-8") as file:
for line in file:
line = line.strip()
pr_number_seen |= pr_num_str in line
if line and not is_valid_line(line):
print(f'Invalid entry in change log: "{line}"')
sys.exit(1)
if not pr_number_seen:
print(
f'Expected that the changelog contains a reference to the PR: "{pr_num_str}"'
)
sys.exit(1)
else:
print("Please provide a file name as a command-line argument.")
sys.exit(1)
Expand Down