chore: sync main into develop (back-merge HR 'Applied for' hotfix)#3869
chore: sync main into develop (back-merge HR 'Applied for' hotfix)#3869rathorevaibhav wants to merge 5 commits into
Conversation
Production deployment - Jun 2
Production deployment - Jun 4
The "Copy candidate details for AI evaluation" button copied the candidate name, application date, graduation year, and application-form fields, but omitted the job the candidate applied for. This adds an "Applied for: <job title>" line (guarded with optional() so it is safe when no job is linked), matching the order shown on the application details page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-applied-for fix: add "Applied for" job title to HR AI-evaluation copy
WalkthroughThe Blade template ChangesJob Title in AI Evaluation Clipboard
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Employee portal
|
||||||||||||||||||||||||||||
| Project |
Employee portal
|
| Branch Review |
refs/pull/3869/merge
|
| Run status |
|
| Run duration | 00m 25s |
| Commit |
|
| Committer | Vaibhav Rathore |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Modules/HR/Tests/Feature/CopyForAiEvaluationTest.php`:
- Around line 15-30: Add a complementary test method to cover the null job
scenario that the existing test does not address. Create a new test method in
the CopyForAiEvaluationTest class that creates an Application with hr_job_id set
to null (similar to the existing
test_clipboard_text_includes_applied_for_job_title method), passes the required
view variables including applicant and application to the view render call, and
then verifies using assertStringNotContainsString that the "Applied for:" text
does not appear in the rendered HTML output when no job is associated with the
application.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 291919c5-e20a-49e8-8dc3-c75181a4376c
📒 Files selected for processing (2)
Modules/HR/Tests/Feature/CopyForAiEvaluationTest.phpresources/views/hr/application/copy-for-ai-evaluation.blade.php
| public function test_clipboard_text_includes_applied_for_job_title() | ||
| { | ||
| $applicant = Applicant::factory()->create(['name' => 'Jane Doe']); | ||
| $job = Job::factory()->create(['title' => 'Senior Laravel Developer']); | ||
| $application = Application::factory()->create([ | ||
| 'hr_applicant_id' => $applicant->id, | ||
| 'hr_job_id' => $job->id, | ||
| ]); | ||
|
|
||
| $html = view('hr.application.copy-for-ai-evaluation', [ | ||
| 'applicant' => $applicant, | ||
| 'application' => $application, | ||
| ])->render(); | ||
|
|
||
| $this->assertStringContainsString('Applied for: ' . $job->title, $html); | ||
| } |
There was a problem hiding this comment.
Test should also verify behavior when job is null.
The test verifies the happy path (job title present), but does not test the guard logic (optional() on line 6 of the template). A second test case should verify that the 'Applied for:' line does not appear when $application->job is null.
Consider adding a complementary test:
public function test_clipboard_text_omits_applied_for_when_no_job()
{
$applicant = Applicant::factory()->create(['name' => 'John Doe']);
$application = Application::factory()->create([
'hr_applicant_id' => $applicant->id,
'hr_job_id' => null,
]);
$html = view('hr.application.copy-for-ai-evaluation', [
'applicant' => $applicant,
'application' => $application,
'applicationFormDetails' => null, // Add missing variable
])->render();
$this->assertStringNotContainsString('Applied for:', $html);
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Modules/HR/Tests/Feature/CopyForAiEvaluationTest.php` around lines 15 - 30,
Add a complementary test method to cover the null job scenario that the existing
test does not address. Create a new test method in the CopyForAiEvaluationTest
class that creates an Application with hr_job_id set to null (similar to the
existing test_clipboard_text_includes_applied_for_job_title method), passes the
required view variables including applicant and application to the view render
call, and then verifies using assertStringNotContainsString that the "Applied
for:" text does not appear in the rendered HTML output when no job is associated
with the application.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3869 +/- ##
=============================================
+ Coverage 10.77% 10.95% +0.18%
Complexity 1600 1600
=============================================
Files 305 305
Lines 7092 7092
=============================================
+ Hits 764 777 +13
+ Misses 6328 6315 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What
Back-merge of
mainintodevelopso develop is in sync with production. The only substantive changemainhad ahead ofdevelopis the HR AI-evaluation copy hotfix from #3864 (bfe41718c— add "Applied for" job title to the AI-evaluation copy). The othermain-only commits were past develop→main release merges.Changes brought into develop
Additive only, merged cleanly with no conflicts:
resources/views/hr/application/copy-for-ai-evaluation.blade.php(+5)Modules/HR/Tests/Feature/CopyForAiEvaluationTest.php(new test, +31)Direction
This updates develop only.
mainis left untouched — the production-release PR (develop → main) will be done separately later.🤖 Generated with Claude Code