Skip to content

test: create the organizations of the restricted lookup test as organizations - #1333

Merged
mnapoli merged 1 commit into
productionfrom
fix/organization-lookup-test
Oct 30, 2026
Merged

mnapoli merged 1 commit into
productionfrom
fix/organization-lookup-test

Conversation

@mnapoli

@mnapoli mnapoli commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

production CI is red since #1327: 3 failures in LookUpUserOrganizationsTest (the three cases of "skips the organizations that keep GitHub from showing them"), with Class "Profile" not found.

#1316 gave organizations their own table (Organization, with its identity on its Profile) while #1327 was open. #1327's new test still created organizations with Profile::factory()->organization() and filtered on ProfileType, without importing either. Each PR was green on its own.

Changes

Only the test: the two known organizations are created with Organization::factory() (the factory passes github_id, handle, name and github_synced_at to the profile, as in UpdateOrCreateOrganizationTest), and the handles are read from Organization. No app code changes. The test still proves what #1327 meant: a 403 skips the organization without caching it as not found or deleting it, and the other lookups go on.

Validation

All local, on a throwaway Postgres (pgvector/pgvector:pg18):

  • vendor/bin/pest tests/Unit/Jobs/LookUpUserOrganizationsTest.php: 10 passed (3 failed before)
  • composer test:lint: pass
  • composer test:types (PHPStan): pass
  • composer test:type-coverage: 100%
  • pest --parallel --coverage --exactly=100.0: 5,139 passed, 100% coverage

No UI change.

Independent review

Independent agent review of base 06bb20c5 and this diff: PASS. It checked the test still covers #1327's behavior against UpdateMentionedOrganizations, and that no other test uses Profile or ProfileType without importing it.

Limitations

None.

Summary by CodeRabbit

  • Tests
    • Updated automated coverage to check that organization handles are returned in sorted order across the tested organization records. The expected handles remain laravel, private, and symfony. This change affects test verification only; no end-user functionality or application behavior is reported as changed.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d183487-da5d-4a2a-8bfe-3d77407cda90
Commits

Reviewing files that changed from the base of the PR and between 06bb20c and f7fa080.

Files selected for processing: 1
  • tests/Unit/Jobs/LookUpUserOrganizationsTest.php

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The unit test now creates Organization records instead of Profile records and checks that the organization handles are sorted.

Changes: Organization lookup test

Layer / File(s) Summary
Organization fixtures and assertions
tests/Unit/Jobs/LookUpUserOrganizationsTest.php
The test creates private and Symfony records with Organization factories and checks all organization handles in sorted order.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Possibly related PRs

Suggested reviewers: nunomaduro

Merge Risk: Minimal · up to f7fa0

The fixture update correctly targets the separate organization table and introduces no identified merge-blocking risk.

Architecture risk: Low · up to f7fa0

The change affects 1 system.

Changed systems: tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (job) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tests/Unit/Jobs/LookUpUserOrganizationsTest.php: The test replaces Profile::factory()->organization() records and a type-filtered Profile query with Organization factories and a query over all organizations. It still expects the sorted handles laravel, private, and symfony.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: the restricted-lookup test now creates its organizations as Organization records. The raw summary confirms the test-only edit. The title is short and specific. It does not …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: the restricted-lookup test now creates its organizations as Organization records. The raw summary confirms the test-only edit. The title is short and specific. It does not cover the test-result details, which is expected.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@mnapoli
mnapoli merged commit 148d3a5 into production Oct 30, 2026
10 checks passed
@mnapoli
mnapoli deleted the fix/organization-lookup-test branch October 30, 2026 20:12
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.

1 participant