Development: Port new gender contracts - #2638
Conversation
…computed re-runs on every title change
…or-not-shown' into bugfix/2321-title-compliance-error-not-shown
…or-not-shown' into bugfix/2321-title-compliance-error-not-shown
…egories-in-sidebar' into feat/2345-add-new-compliance-categories-in-sidebar
fix namings
…egories-in-sidebar' into feat/2345-add-new-compliance-categories-in-sidebar
…sive-api-requests-triggering-genderdecoder # Conflicts: # src/main/java/de/tum/cit/aet/ai/service/AiService.java # src/main/java/de/tum/cit/aet/ai/web/AiResource.java # src/main/java/de/tum/cit/aet/job/service/JobService.java # src/main/webapp/app/generated/api/ai-resource-api.ts # src/main/webapp/app/job/job-creation-form/job-creation-form.component.ts # src/test/java/de/tum/cit/aet/ai/web/rest/AiResourceTest.java
… feat/2637-port-new-gender-contracts # Conflicts: # src/main/webapp/app/job/job-creation-form/job-creation-form.component.html # src/main/webapp/app/job/job-creation-form/job-creation-form.component.ts # src/main/webapp/app/shared/components/atoms/editor/editor.component.ts # src/main/webapp/app/shared/components/molecules/ai-assistant-card/ai-assistant-card.component.ts # src/main/webapp/app/shared/gender-bias-analysis/gender-bias-analysis.ts # src/main/webapp/app/shared/gender-bias-analysis/gender-bias-analysis.utils.ts # src/test/webapp/app/shared/components/atoms/editor/editor.component.spec.ts # src/test/webapp/util/gender-bias-analysis.service.mock.ts
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 medium |
| CodeStyle | 3 minor |
🟢 Metrics 22 complexity
Metric Results Complexity 22
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
- replace the removed gender-bias analysis response with BiasedIssueDTO arrays - derive inclusive, non-inclusive, and neutral states from biased issue types - update the editor highlights, analysis dialog, assistant card, and review count - source gender findings and loading state from the existing job analysis workflow - remove client-side gender-bias analysis service and test mock - update affected component and utility tests for the new contracts
Development: Port new gender contracts
|
📊 Client Test Coverage Too Low 🔍 View coverage locally: pnpm run test:ci
open build/test-results/vitest/coverage/index.html🌐 View coverage from GitHub: |
|
🤖 No OpenAPI or client changes needed. |
|
🤖 No OpenAPI or client changes needed. |
…nder-contracts # Conflicts: # src/main/resources/config/liquibase/master.xml # src/main/webapp/app/job/job-creation-form/job-creation-form.component.html # src/main/webapp/app/job/job-creation-form/job-creation-form.component.ts # src/main/webapp/app/shared/components/atoms/editor/editor.component.ts # src/main/webapp/app/shared/components/molecules/ai-assistant-card/ai-assistant-card.component.ts # src/main/webapp/app/shared/gender-bias-analysis/gender-bias-analysis.utils.ts # src/test/webapp/app/shared/components/atoms/editor/editor.component.spec.ts
- add Unicode-aware word-boundary detection to the gender-bias analysis utility - update EditorComponent to skip gender findings inside longer words - test that Führung is not highlighted inside Personalführung - test that lead is not highlighted inside misleading
az108
left a comment
There was a problem hiding this comment.
This is in good shape — merges cleanly (git merge-tree origin/main HEAD exits 0, zero conflicts), which is worth calling out given the branch it replaces does not. One deletable file, inline.
Checks that passed
| Check | Result |
|---|---|
Merge into main |
clean, 0 conflicts |
| Word-boundary fix carried over from #2630 | isWordChar in the shared utils, applied at editor.component.ts:453 |
| Empty-token guard | present on both loops (compliance and gender) |
| Boundary guard scoped correctly | gender loop only — right call, compliance snippets are multi-word phrases where it would be wrong |
| i18n parity | 364/364 keys, genderDecoder complete in EN and DE |
| Test naming | all new it(...) start with should |
| New spec | gender-bias-analysis.utils.spec.ts covers trim/dedup/type-filter plus undefined and empty input |
The isWordChar JSDoc is the good kind — it records why \p{L} rather than \w (umlauts, ß) and why the hyphen is excluded (mirrors deHyphenNonCodedWords server-side). That reasoning is not recoverable from the code alone, so thanks for writing it down.
One thing that improved in the port: isGenderAnalyzing is now bound as [isGenderAnalyzing]="isAnalyzing()", a plain signal, rather than the genderBiasService.isAnalyzing(...) service-method call the previous branch had in the template.
I deliberately did not flag the raw 'NON_INCLUSIVE' literal in getUniqueNonInclusiveWords — it matches computeCodingStatus in the same file, and type is a narrow 'NON_INCLUSIVE' | 'INCLUSIVE' union, so a typo would fail to compile.
Context
I have closed #2630 in favour of this PR. 11 of the 12 files here overlap with it, that branch could no longer merge after #2465 removed the API it was built on, and everything raised in review there was resolved before closing — the fixes carry forward in this branch.
| xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
| xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> | ||
|
|
||
| <changeSet id="053a_add_biased_issues_to_jobs" author="melissa"> |
There was a problem hiding this comment.
This whole file can go — it's a leftover from before 00000000000052_add_biased_issues_to_jobs.xml merged to main.
It is byte-identical to the merged 052, apart from the changeset id prefixes:
052a_add_biased_issues_to_jobs -> 053a_add_biased_issues_to_jobs
052b_add_unique_constraint_biased_issues -> 053b_add_unique_constraint_biased_issues
052c_rename_gender_bias_score_to_ai_score -> 053c_rename_gender_bias_score_to_ai_score
It is also not registered in master.xml — the diff doesn't touch that file at all — so it never runs.
Those two facts happen to cancel out into "harmless": as-is it is dead weight. But if someone later notices the missing include and "fixes" it, this would re-attempt createTable job_biased_issues and the gender_bias_score -> ai_score rename on a schema where 052 already did both. The preConditions onFail="MARK_RAN" guards would absorb it, so still no breakage — just a second changeset that does nothing. Cleanest is to delete the file rather than leave that trap.
job_biased_issues and ai_score are already on main via 052, so nothing here is needed.
Checklist
General
Client
Motivation and Context
This PR ports the Gender Decoder integration to the new BiasedIssue / JobAnalysisDTO contracts ahead of the dependent PRs being merged, so the required compatibility changes are already prepared and don’t block on merge order.
Fixes: #2637 resulting from #2630 and #2465 will collide head-on.
Description
The editor no longer subscribes to
GenderBiasAnalysisService.getAnalysisForField(). It receives findings through a newbiasedAnalysisinput instead, so the removed endpoint is no longer referenced from the atom.toObservable,fieldIdChanges$and the service injection are gone;genderBiasHighlightsnow derives from the input.Contract migration
GenderBiasAnalysisResponse/BiasedWordDTO→BiasedIssueDTOcodingstring values ('non-inclusive-coded','inclusive-coded') →computeCodingStatus()returning'NON_INCLUSIVE'/'INCLUSIVE'/'NEUTRAL'type: 'non-inclusive'→BiasedIssueDTOTypeEnum.NON_INCLUSIVEComplianceIssue→ComplianceIssueDTOin the assistant card and filter typesPrerequisites:
Review Progress
Code Review
Manual Tests
Screenshots
Test Coverage
Client
Last updated: 2026-08-24 16:13:20 UTC