Skip to content

Conversation

@komainu8
Copy link
Member

@komainu8 komainu8 commented Dec 15, 2025

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_index to detect the first (latest) PostgreSQL version
  • Modified the logic to set latest_postgresql_version from 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.

Comment on lines 56 to 57
# 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.
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

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".

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
komainu8 and others added 2 commits December 15, 2025 13:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@komainu8
Copy link
Member Author

I've fixed them.

Comment on lines 52 to 60
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
Copy link
Member

Choose a reason for hiding this comment

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

Can we fix

latest_postgresql_version = components[2].strip
instead of here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for your comment.
I've fixed it.

Comment on lines 32 to 33
latest_postgresql_version =
alpine_type_paths.sort.reverse[0].split("/")[1]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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

alpine_type_paths = Dir.glob("alpine/*") - ["alpine/build.sh"]
alpine_slim_type_paths = Dir.glob("alpine/*-slim")
alpine_type_paths -= alpine_slim_type_paths
to reduce code here?

Could you add a comment that shows example value?

# INPUT_VALUE -> OUTPUT_VALUE

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for your comment.
I've fixed it.

@komainu8 komainu8 merged commit 0daf648 into pgroonga:main Dec 16, 2025
18 checks passed
@komainu8 komainu8 deleted the fix-wrong-update-list branch December 16, 2025 01:25
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.

3 participants