Skip to content

chore: improve build workflows#3262

Draft
yenfryherrerafeliz wants to merge 6 commits intoaws:masterfrom
yenfryherrerafeliz:build_workflow_improvements
Draft

chore: improve build workflows#3262
yenfryherrerafeliz wants to merge 6 commits intoaws:masterfrom
yenfryherrerafeliz:build_workflow_improvements

Conversation

@yenfryherrerafeliz
Copy link
Contributor

Description of changes:
Improve build workflows so they are now executed from a centralized orchestration by following a command-runner architecture.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yenfryherrerafeliz yenfryherrerafeliz marked this pull request as draft March 17, 2026 16:10
Copy link
Member

@stobrien89 stobrien89 left a comment

Choose a reason for hiding this comment

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

A couple of changes requested- Not sure how feasible this is for every class, but this is a lot of new logic with no unit tests. The RemoveServiceCommand class should definitely have some unit tests

}
}

protected function parseOptions(array $shortOptions, array $longOptions = []): array
Copy link
Member

Choose a reason for hiding this comment

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

getOpt() is notoriously fragile. We should parse the args manually like in RemoveServiceCommand

$isSuccessful = true;
} catch (\GuzzleHttp\Exception\ServerException $e) {
$this->output("{$filename} failed to upload:");
var_dump($e->getMessage());
Copy link
Member

Choose a reason for hiding this comment

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

seems like $this->error() or $this->output() should be called here

$this->output("Failed upload of {$asset['name']} at {$asset['browser_download_url']} has successfully been deleted.");
} else {
$this->output("Failed upload of {$asset['name']} at {$asset['browser_download_url']} was unable to be deleted.");
var_dump($e);
Copy link
Member

Choose a reason for hiding this comment

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

seems like $this->error() or $this->output() should be called here too

}

$docs = '* - ' . $name . ': ' . $docs;
echo wordwrap($docs, 70, "\n* ") . "\n";
Copy link
Member

Choose a reason for hiding this comment

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

should $this->output() be called here?

function ($retries, $request, $response) {
$statusCode = $response->getStatusCode();
if ($retries < self::MAX_ATTEMPTS && !in_array($statusCode, [200, 201, 202])) {
echo "Attempt failed with status code {$statusCode}: "
Copy link
Member

Choose a reason for hiding this comment

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

should $this->output() be called here too?

exec('git add ' . $escapedPaths . ' 2>&1', $output, $exitCode);
if ($exitCode !== 0) {
$this->error('git add failed: ' . implode("\n", $output));
exit($exitCode);
Copy link
Member

Choose a reason for hiding this comment

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

Seeing exit() called in a handful of places where maybe an exception should be thrown or an error code returned to doExecute()?


$changelogBuilder->buildChangelog();

// Omit fixEndpointFile() call - method doesn't exist on ChangelogBuilder
Copy link
Member

Choose a reason for hiding this comment

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

is this comment intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I just want to make sure it keeps documented for future revisions since that method is called here, in the old script file, but is not a member of ChangelogBuilder.

);

$burgomaster->startSection('test-phar');
$burgomaster->exec('php ' . $buildDir . '/WorkflowCommandRunner.php test-phar');
Copy link
Member

Choose a reason for hiding this comment

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

could the runner path be moved to a constant?

return 'php build/WorkflowCommandRunner.php phar-test-runner [-- phpunit/behat options]';
}

protected function doExecute(array $args): int
Copy link
Member

Choose a reason for hiding this comment

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

does this actually execute the tests?

Copy link
Contributor Author

@yenfryherrerafeliz yenfryherrerafeliz left a comment

Choose a reason for hiding this comment

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

Not sure how feasible this is for every class, but this is a lot of new logic with no unit tests. The RemoveServiceCommand class should definitely have some unit tests.

Yes, maybe we should have test coverage, however, the reason why I initially decided not to do it was because those scripts did not have either before this improvements, and we are not changing or introducing functionalities, except for the service removal, but just migrating to a different structural and functional architecture. I can definitely add test coverage if needed.

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