Skip to content

Conversation

@Pansysk75
Copy link

Previously, if a submission happened on a non-existent project, the CheckForTooManyBuilds() would result in a 500 http code, which caused me some confusion.

Thanks!

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

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

Simply relocating the check is not a robust fix. Instead, it would be better to check the return value of $this->project->FindByName($projectname); and use $this->failProcessing() to return an appropriate error if the project does not exist.

@Pansysk75
Copy link
Author

Pansysk75 commented Dec 14, 2025

Simply relocating the check is not a robust fix. Instead, it would be better to check the return value of $this->project->FindByName($projectname); and use $this->failProcessing() to return an appropriate error if the project does not exist.

That makes sense, thank you for the feedback! I made the requested changes. Please feel free to take the wheel, as I'm not too experienced with either the CDash codebase or php.

Comment on lines -163 to -165
} elseif (intval($this->project->Id) < 1) {
Log::info("Rejected submission with invalid project name: $projectname");
$this->failProcessing($filename, Response::HTTP_NOT_FOUND, 'The requested project does not exist.');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking about this a bit more, why doesn't this catch the error? Can you post the stack trace for the error you're experiencing?

Copy link
Author

Choose a reason for hiding this comment

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

That place is never reached, as an exception is thrown in this function, called a few lines before that:

$this->project->CheckForTooManyBuilds();

public function CheckForTooManyBuilds(): bool
{
if (!$this->Id) {
throw new RuntimeException('ID not set for project');
}

I also wanted to post the logging output, but I cannot get it to work (storage/logs/cdash.log is empty)

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