Fix the setting incorrect the latest version when PostgreSQL is released new major version#78
Conversation
…sed new major version.
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the script incorrectly identified the latest PostgreSQL version when a new major version was released. Previously, the script would read the latest version from an existing README entry, which became stale when PostgreSQL released a new version. The fix ensures the script dynamically determines the latest version from the sorted list of type paths.
- Changed the loop to use
each_with_indexto detect the first (latest) PostgreSQL version - Modified the logic to set
latest_postgresql_versionfrom the first iteration instead of reading from the existing README - Updated README.md to reflect that PostgreSQL 18 is now the latest version with the "latest" tag
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| update-tag-list.rb | Added index tracking to the type_paths loop to dynamically determine the latest PostgreSQL version from the sorted list instead of reading from existing README content |
| README.md | Updated tag assignments to show PostgreSQL 18 as the latest version (with "latest" tag) instead of PostgreSQL 17 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
update-tag-list.rb
Outdated
| # If the latest vestion get by "components[2].strip", | ||
| # this script set incorrect the version as the latest version when PostgreSQL is released new version. |
There was a problem hiding this comment.
Grammar issues: "this script set incorrect the version" should be "this script incorrectly sets the version" and "PostgreSQL is released new version" should be "PostgreSQL releases a new version".
| # If the latest vestion get by "components[2].strip", | |
| # this script set incorrect the version as the latest version when PostgreSQL is released new version. | |
| # If the latest version is obtained by "components[2].strip", | |
| # this script incorrectly sets the version as the latest version when PostgreSQL releases a new version. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I've fixed them. |
update-tag-list.rb
Outdated
| if i == 0 | ||
| # type_paths have already sorted to descending order by the version of PostgreSQL. | ||
| # So, when "i == 0" is true, postgresql_version is the latest version. | ||
| # | ||
| # If the latest version is obtained by "components[2].strip", | ||
| # this script incorrectly sets the version as the latest version | ||
| # when releases a new version of PostgreSQL. | ||
| latest_postgresql_version = postgresql_version | ||
| end |
There was a problem hiding this comment.
Thank you for your comment.
I've fixed it.
update-tag-list.rb
Outdated
| latest_postgresql_version = | ||
| alpine_type_paths.sort.reverse[0].split("/")[1] |
There was a problem hiding this comment.
| latest_postgresql_version = | |
| alpine_type_paths.sort.reverse[0].split("/")[1] | |
| latest_postgresql_version = alpine_type_paths.sort.last.split("/")[1] |
Can we sort alpine_type_paths (and alpine_slim_type_paths) at
Lines 15 to 17 in f3cdd1f
Could you add a comment that shows example value?
# INPUT_VALUE -> OUTPUT_VALUEThere was a problem hiding this comment.
Thank you for your comment.
I've fixed it.
Because if the latest version is obtained by "components[2].strip", this script incorrectly sets the version as the latest version when releases a new version of PostgreSQL.