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

PHPC-2420: Initial composer.json for pie support #1624

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Sep 2, 2024

PHPC-2420

Note: pie support is experimental. No support will be given for installation issues with pie. The integration with pie is mainly done to be able test pie itself.

This is an initial version of a composer.json file to be used with pie. Once this PR has been merged to master, we can add the extension to packagist; after tagging a release we can install the extension using pie.

@alcaeus alcaeus requested a review from jmikola September 2, 2024 12:05
@alcaeus alcaeus self-assigned this Sep 2, 2024
@alcaeus alcaeus changed the title Initial composer.json for pie support PHPC-2420: Initial composer.json for pie support Sep 2, 2024
Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

No objections to merging.

{
"name": "with-mongodb-client-side-encryption",
"description": "Enable client-side encryption (auto/yes/no)",
"needs-value": true
Copy link
Member

Choose a reason for hiding this comment

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

Noted that there is no way to specify a default value. Php\Pie\ConfigureOption appears to be where the parsing for this object lives.

Copy link
Member Author

Choose a reason for hiding this comment

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

@asgrim confirmed that configure options are only passed to configure if they are explicitly given during the installation process. Thus, the default is implicitly applied by our configuration scripts. As I understand it, this is different from pecl which always passes the configured flags and relies on the defined default value when the user does not input their own value.

Copy link
Member

Choose a reason for hiding this comment

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

Got it. I was worried needs-value: true would require all of these options to be specified at the time of package installation. Rather, it just requires a value iff the user specifies the option. That sounds like an improvement over PECL.

@@ -0,0 +1,72 @@
{
"name": "mongodb/mongodb-extension",
Copy link
Member

Choose a reason for hiding this comment

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

Would "mongodb/mongodb" conflict with PHPLIB, even though the package type differs ("php-ext" vs. "library")? I suppose I'm asking whether the pie packages will share the same namespace with everything else in Packagist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, extensions and packages all share the same namespace, so we can't choose mongodb/mongodb as a name.

@@ -0,0 +1,72 @@
{
Copy link
Member

@jmikola jmikola Sep 3, 2024

Choose a reason for hiding this comment

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

I spent a while getting pie running locally (had to chase down missing extensions for azjezz/psl) just to find out that it doesn't support a validate command to check this JSON file. Well, at least I'll have it ready for future use 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll use the opportunity to summon @asgrim, as they'd be in a better place to give you an idea of if and when to expect a pie validate command.

Copy link

Choose a reason for hiding this comment

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

You can actually just use composer validate; the schema for the php-ext bit is actually built in there.

@alcaeus alcaeus merged commit a7091e8 into mongodb:master Sep 4, 2024
72 checks passed
@alcaeus alcaeus deleted the pie-composer.json branch September 4, 2024 06:56
}
]
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Missing newline.

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.

4 participants