Skip to content

fix: Replace custom module in PhpSdkDev#9379

Merged
jedevc merged 1 commit into
dagger:mainfrom
charjr:remove-custom-module
Jan 14, 2025
Merged

fix: Replace custom module in PhpSdkDev#9379
jedevc merged 1 commit into
dagger:mainfrom
charjr:remove-custom-module

Conversation

@charjr
Copy link
Copy Markdown
Contributor

@charjr charjr commented Jan 14, 2025

Thanks to the :expect flag on calls to withExec
The custom-module always-exec used in the PhpSdkDev is now obsolete.

This PR removes the depedency on the custom module always-exec.

@charjr charjr requested a review from a team as a code owner January 14, 2025 11:38
@charjr charjr force-pushed the remove-custom-module branch 2 times, most recently from fb106a6 to 8d4df2b Compare January 14, 2025 11:40
Comment thread sdk/php/dev/src/PhpSdkDev.php Outdated
);

if (dag()->alwaysExec()->lastExitCode($result) === '3') {
if ($result->exitCode() === '3') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

exitCode returns an int:

public function exitCode(): int
(unlike lastExitCode which returns a string https://github.com/charjr/dagger-always-exec/blob/d478c1aaf4c5290926d2d1978d98d9f0054529eb/src/AlwaysExec.php#L61)

Copy link
Copy Markdown
Contributor Author

@charjr charjr Jan 14, 2025

Choose a reason for hiding this comment

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

Good spot! I've fixed this and reversed it to be stricter.

Instead of throwing on 3 (the bad exit code we expect to see) I've changed it to throw on anything that isn't 0, 1, 2 (the good exit codes we expect to see).

Thanks to the `:expect` flag on calls to `withExec`
The custom-module _always-exec_ used in the PhpSdkDev is now obsolete.

This PR removes the depedency on the custom module _always-exec_.

Also throw an error for anything that is **not** what we expect,
This is different from prior behaviour which only threw for errors we
expected. (exit code 3)

Signed-off-by: John Charman <john.charman@imhotek.net>
@charjr charjr force-pushed the remove-custom-module branch from 8d4df2b to cc3a93e Compare January 14, 2025 11:54
@jedevc jedevc merged commit 1ff817d into dagger:main Jan 14, 2025
@charjr charjr deleted the remove-custom-module branch January 14, 2025 14:09
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