Skip to content

Conversation

@khustup2
Copy link
Contributor

🚀 🚀 Pull Request

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Things to be aware of

Things to worry about

Additional Context

Copilot AI review requested due to automatic review settings December 13, 2025 10:15
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 13, 2025

Quality Gate Passed Quality Gate passed

Issues
1 New issue
4 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

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 refactors PostgreSQL version build configuration by moving CMake argument logic from bash script into Python, enabling explicit PostgreSQL version selection via command-line arguments.

Key Changes:

  • Added --pg-versions flag to build_pg_ext.py for explicit PostgreSQL version control
  • Removed bash-based CMake flag logic from GitHub workflow in favor of Python argument passing
  • Enhanced CLI argument parsing to support multiple flags (--deeplake-shared/static, --pg-versions)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scripts/build_pg_ext.py Added --pg-versions argument parsing, updated run() function to accept and process PostgreSQL versions list, refactored argument parsing to handle multiple flags
.github/workflows/pg-extension-build.yaml Simplified workflow by delegating PostgreSQL version logic to Python script via --pg-versions flag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

deeplake_link_type = "static"
i += 1
elif arg == "--pg-versions":
if i + 1 >= len(sys.argv):
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

The boundary check should use > instead of >= because valid indices go up to len(sys.argv) - 1. When i + 1 equals len(sys.argv), it's the first invalid index. The current condition would incorrectly allow access when i + 1 == len(sys.argv), causing an IndexError on line 239.

Copilot uses AI. Check for mistakes.

if len(sys.argv) > 3:
raise Exception("Too many command line arguments")
raise Exception(f"Invalid option '{arg}'. Use --deeplake-shared, --deeplake-static, or --pg-versions")
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

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

The error message does not account for unknown arguments that might follow valid flags. Consider including information that flags requiring values (like --pg-versions) must be followed by their value, to help users diagnose issues when arguments are in the wrong order.

Suggested change
raise Exception(f"Invalid option '{arg}'. Use --deeplake-shared, --deeplake-static, or --pg-versions")
raise Exception(
f"Invalid option '{arg}'. Use --deeplake-shared, --deeplake-static, or --pg-versions.\n"
"Note: Flags like --pg-versions require a value (e.g., '16,17,18' or 'all') immediately after the flag.\n"
"If you provided another flag after --pg-versions, it may have been interpreted as its value. Please check the order of your arguments."
)

Copilot uses AI. Check for mistakes.
@khustup2 khustup2 merged commit b629a32 into main Dec 13, 2025
8 checks passed
@khustup2 khustup2 deleted the fix-build branch December 13, 2025 16:24
khustup2 added a commit that referenced this pull request Dec 16, 2025
* initial

* lint

* add missing env

* test

* edit

* test

* debug

* edits

* edits

* edits

* edits

* edits

* edits

* edits

* edits

* edits

* debug

* debug

* Explicitly pass cmake arguments to build. (#3086)

* edits

* edits

* edits

* test

* typo

* test

* Fixed merge issue.

* Update .github/workflows/pg-extension-build.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: vladbabayan05 <vlad@activeloop.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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