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

Update workflow to check that share/version.py and CHANGELOG match #808

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

constanca-m
Copy link
Contributor

What and why?

  • changelog workflow is now version-update workflow
  • It checks that both CHANGELOG and version.py are changed together and both versions match.

We need this because currently we can be updating CHANGELOG without ever changing the share/version.py version which does not make sense and should not be possible. It is also not clear that both files should be changed together. Hopefully this PR helps in clarifying that.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

Related issues

Results

I tested this locally. These are my local test results.

Test 1: Versions match

# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License 2.0;
# you may not use this file except in compliance with the Elastic License 2.0.

version = "1.17.2"
### v1.17.2 - 2024/09/23
##### Bug fixes
* Cache EC2:DescribeRegion API response to avoid throttling and improve performance.

image

Test 2: Update CHANGELOG version, but not version.py

### v1.17.3 - 2024/09/23
##### Bug fixes
* Cache EC2:DescribeRegion API response to avoid throttling and improve performance.

image

Test 3: Update version.py but not CHANGELOG

# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License 2.0;
# you may not use this file except in compliance with the Elastic License 2.0.

version = "1.17.4"

image

Test 4: Unexpected line in CHANGELOG

Adding a first unexpected line.
### v1.17.3 - 2024/09/23
##### Bug fixes
* Cache EC2:DescribeRegion API response to avoid throttling and improve performance.

image

Signed-off-by: constanca <[email protected]>
@constanca-m constanca-m self-assigned this Sep 24, 2024
@kaiyan-sheng
Copy link
Contributor

Nice change! Thanks @constanca-m ! The test cases are useful! Did we try if version number is invalid? Like version = "v1.17.2" for example?

@constanca-m
Copy link
Contributor Author

constanca-m commented Sep 24, 2024

Did we try if version number is invalid?

No, we do not check the format of the version field. Should we? @kaiyan-sheng

@kaiyan-sheng
Copy link
Contributor

@constanca-m I was more thinking about the manual testing you did. But based on the regular expression you defined for version_py, if version starts with v it should fail. So we should be good.

@constanca-m constanca-m merged commit f371b5e into elastic:main Sep 26, 2024
4 checks passed
@constanca-m constanca-m deleted the version-update-changelog branch September 26, 2024 15:43
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.

2 participants