Skip to content

Fix/gitea repostiories#185

Merged
ht3aa merged 3 commits intomainfrom
fix/gitea-repostiories
Apr 3, 2026
Merged

Fix/gitea repostiories#185
ht3aa merged 3 commits intomainfrom
fix/gitea-repostiories

Conversation

@ht3aa
Copy link
Copy Markdown
Owner

@ht3aa ht3aa commented Apr 3, 2026

No description provided.

@ht3aa ht3aa added the fix label Apr 3, 2026
@ht3aa ht3aa merged commit 121b51c into main Apr 3, 2026
2 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds an applications relation manager to the CompanyJob resource in Filament and refactors Gitea repository provisioning to use job slugs as names. It also refactors the Gitea repository URL into a model attribute and includes new feature tests. Feedback suggests handling potential null values for application statuses to avoid type errors and appending job IDs to truncated repository names to prevent collisions.

Comment on lines +56 to +57
->formatStateUsing(fn (ApplicationStatus $state): string => $state->getLabel())
->color(fn (ApplicationStatus $state): string => $state->getColor())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The closures for formatStateUsing and color use a non-nullable type hint for ApplicationStatus. If the status field is null in the database, this will trigger a TypeError. It is safer to use a nullable type hint and handle the null case with the null-safe operator or a fallback.

                    ->formatStateUsing(fn (?ApplicationStatus $state): string => $state?->getLabel() ?? '')
                    ->color(fn (?ApplicationStatus $state): ?string => $state?->getColor())

return 'remote-work-'.$job->id;
}

return mb_substr($slug, 0, 100);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Truncating the slug to 100 characters might lead to repository name collisions if multiple jobs have long slugs that are identical for the first 100 characters. While 100 characters is a generous limit, appending the job ID (or a portion of it) would guarantee uniqueness even after truncation.

        return mb_substr($slug, 0, 90) . '-' . $job->id;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant