Skip to content

initial normalization for pushed_at#105

Merged
Meldiron merged 4 commits into
utopia-php:mainfrom
jaysomani:fix/pushed-at-normalization
May 22, 2026
Merged

initial normalization for pushed_at#105
Meldiron merged 4 commits into
utopia-php:mainfrom
jaysomani:fix/pushed-at-normalization

Conversation

@jaysomani
Copy link
Copy Markdown
Contributor

No description provided.

@jaysomani jaysomani marked this pull request as ready for review May 22, 2026 06:27
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d933ffd818

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docker-compose.yml
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Greptile Summary

This PR normalizes pushed_at across GitLab, Gitea, and Gogs adapters by surfacing last_activity_at (GitLab) or updated_at (Gitea/Gogs) under a uniform key. It also restructures the CI and Docker Compose setup into per-adapter matrix jobs with isolated profiles, and adds adapter-specific testListBranchesEmptyRepo tests.

  • GitLab.php, Gitea.php, and Gogs.php each apply consistent is_array guards before writing pushed_at, mirroring the pattern already used for other fields.
  • phpunit.xml and both CI workflow files are split into per-adapter suites (gitea, forgejo, github, gitlab, gogs) backed by Docker Compose profiles with required: false on all service dependencies.
  • Gitea.php also includes two unrelated changes: listBranches now uses decode: false with explicit json_decode (enabling cleaner empty-repo handling), and generateCloneCommand defaults an empty rootDirectory to * so sparse checkout checks out all files rather than nothing.

Confidence Score: 5/5

Safe to merge; the normalization logic is consistent and well-guarded across all three adapters

The pushed_at mapping is straightforward — GitLab uses last_activity_at, Gitea/Gogs use updated_at as a fallback — and is_array guards are applied before every write. The CI restructuring is mechanical and the docker-compose required: false additions are correct for profile-based isolation. No new logic errors were found in the production adapter code.

The two bundled changes in Gitea.php (listBranches decode strategy and generateCloneCommand rootDirectory default) are unrelated to pushed_at and deserve a second look to confirm intent, but neither introduces a correctness problem.

Important Files Changed

Filename Overview
src/VCS/Adapter/Git/GitLab.php Adds pushed_at from last_activity_at in createRepository, getRepository, and searchRepositories; is_array guard is now correctly applied in getRepository
src/VCS/Adapter/Git/Gitea.php Normalizes pushed_at via updated_at fallback across createRepository, getRepository, and searchRepositories; also changes listBranches to manual json_decode and adds a rootDirectory defaulting change in generateCloneCommand unrelated to the PR's stated purpose
src/VCS/Adapter/Git/Gogs.php Mirrors Gitea's pushed_at normalization in createRepository and searchRepositories; getRepository is inherited from Gitea and also covered
tests/VCS/Adapter/GiteaTest.php Adds pushed_at assertions in testCreateRepository, testGetRepository, and testSearchRepositories; overrides testListBranchesEmptyRepo to use correct owner
tests/VCS/Adapter/GitLabTest.php Adds pushed_at assertions in createRepository and getRepository tests, and adds testListBranchesEmptyRepo; assertNotFalse(\strtotime(...)) assertions lack null guard (previously flagged)
tests/VCS/Base.php Adds pushed_at assertions in testSearchRepositories and testCreateRepository; Base.php testCreateRepository uses unguarded strtotime on a freshly-created repo (previously flagged)
tests/VCS/Adapter/GitHubTest.php Correctly uses the null-safe pattern ($result['pushed_at'] === null
phpunit.xml Splits single suite into per-adapter test suites (gitea, forgejo, github, gitlab, gogs); missing newline at end of file
docker-compose.yml Adds per-adapter Docker Compose profiles and makes all service dependencies optional (required: false) to support running only a single adapter's stack

Reviews (2): Last reviewed commit: "updated with suggestions" | Re-trigger Greptile

Comment thread tests/VCS/Adapter/GitHubTest.php Outdated
Comment thread src/VCS/Adapter/Git/GitLab.php Outdated
Comment thread tests/VCS/Base.php
@Meldiron Meldiron added the test Enables E2E tests in CI/CD label May 22, 2026
@Meldiron Meldiron merged commit 2b81213 into utopia-php:main May 22, 2026
4 of 5 checks passed
@Meldiron Meldiron mentioned this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Enables E2E tests in CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants