Skip to content

audits: add I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys check - #1723

Merged
kaligrafy merged 1 commit into
chairemobilite:mainfrom
kaligrafy:auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp
Jul 17, 2026
Merged

audits: add I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys check#1723
kaligrafy merged 1 commit into
chairemobilite:mainfrom
kaligrafy:auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp

Conversation

@kaligrafy

@kaligrafy kaligrafy commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new interview audit check, I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys, which flags an interview when the respondent would like to participate in other surveys (wouldLikeToParticipateInOtherSurveys) but did not provide a contactEmail.
  • This ports od_mtl_2023's v1 check I_M_ContactEmailButAcceptedToBeContacted (dropped in v2 with no replacement) using core Interview attributes that already exist (wouldLikeToParticipateInOtherSurveys, contactEmail), so no new attribute or config is needed.
  • Email format itself is intentionally out of scope here — it's already covered separately by the existing I_I_ContactEmail check.

Test plan

  • New unit test I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys.test.ts (parametric it.each), covering: opted-in + email present (pass), not opted-in + missing email (pass), opted-in + empty string email (fail), opted-in + undefined email (fail).
  • yarn workspace evolution-backend test -- auditChecks/checks/__tests__/interview — all 105 tests pass.
  • yarn lint — no new errors/warnings introduced.
  • yarn format — applied.
  • Added en/fr translations in locales/*/audits.json.
  • No CHANGELOG.md entry (individual audit checks aren't tracked there).

Summary by CodeRabbit

  • New Features

    • Added an audit warning when respondents want to participate in other surveys but have not provided a contact email.
    • Added English and French translations for the new audit message.
  • Documentation

    • Updated audit-check authoring guidance and inventory examples.
  • Tests

    • Added coverage for valid, missing, and empty contact email scenarios.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kaligrafy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 212e7593-da40-4f4d-8b03-4722b82e4f1d

📥 Commits

Reviewing files that changed from the base of the PR and between 23c0738 and c3a7633.

📒 Files selected for processing (5)
  • locales/en/audits.json
  • locales/fr/audits.json
  • packages/evolution-backend/src/services/audits/auditChecks/README.md
  • packages/evolution-backend/src/services/audits/auditChecks/checks/InterviewAuditChecks.ts
  • packages/evolution-backend/src/services/audits/auditChecks/checks/__tests__/interview/I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys.test.ts

Walkthrough

Adds an interview audit check that reports an error when a respondent wants to participate in other surveys without providing a contact email. English and French translations, parameterized tests for valid and invalid cases, and audit-check authoring guidance are also updated.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: greenscientist, tahini, samuel-duhaime

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the new audit check added in this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

❤️ Share

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

@kaligrafy kaligrafy changed the title audits: add I_M_ContactEmailButAcceptedToBeContactedForHelp check audits: add I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys check Jul 15, 2026
@kaligrafy
kaligrafy requested a review from greenscientist July 15, 2026 14:47
@kaligrafy
kaligrafy force-pushed the auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp branch 2 times, most recently from 222b72d to 23c0738 Compare July 15, 2026 16:36
@greenscientist

Copy link
Copy Markdown
Contributor

@kaligrafy , peux-tu sortir les 2 derniers commits dans leur propre PR ? Ca comme pas rapport ici.

@greenscientist

Copy link
Copy Markdown
Contributor

Je suis aussi curieux, ceci ne devrait pas être bloqué au niveau du questionnaire ? Genre tu me peux pas répondre que tu veux faire d'autres enquetes sans mettre ton courriel?

@kaligrafy

kaligrafy commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Je suis aussi curieux, ceci ne devrait pas être bloqué au niveau du questionnaire ? Genre tu me peux pas répondre que tu veux faire d'autres enquetes sans mettre ton courriel?

C'est effectivement vérifié dans le questionnaire, mais si le répondant revient à la seciton plus tard, efface son courriel, et qu'il part, on aura perdu l'info et l'audit le détectera automatiquement.

C'est maintenant ajouté au Readme des audits:
#1725
#1726

@kaligrafy
kaligrafy force-pushed the auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp branch from 23c0738 to 25dfce2 Compare July 15, 2026 20:21
@kaligrafy

Copy link
Copy Markdown
Contributor Author

@kaligrafy , peux-tu sortir les 2 derniers commits dans leur propre PR ? Ca comme pas rapport ici.

Fait

kaligrafy added a commit to kaligrafy/evolution that referenced this pull request Jul 15, 2026
Addresses greenscientist's review comment on chairemobilite#1723: adds the missing
case where contactEmail is present but wouldLikeToParticipateInOtherSurveys
is false, to keep the parametric test table complete.
kaligrafy added a commit to kaligrafy/evolution that referenced this pull request Jul 15, 2026
Addresses greenscientist's review comment on chairemobilite#1723: adds the missing
case where contactEmail is present but wouldLikeToParticipateInOtherSurveys
is false, to keep the parametric test table complete.
@kaligrafy
kaligrafy force-pushed the auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp branch from fb1151a to 96d0850 Compare July 15, 2026 20:26
@kaligrafy
kaligrafy requested a review from greenscientist July 15, 2026 20:27

@greenscientist greenscientist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tu as encore mis la correction de la PR dans un commit à part... This need to be squashed...

@kaligrafy
kaligrafy force-pushed the auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp branch from 96d0850 to add8b8b Compare July 16, 2026 19:06
@kaligrafy

Copy link
Copy Markdown
Contributor Author

Tu as encore mis la correction de la PR dans un commit à part... This need to be squashed...

C'est corrigé

@kaligrafy
kaligrafy requested a review from greenscientist July 16, 2026 19:09
Comment thread CHANGELOG.md Outdated
- Segment section configuration accepts additional widget names as an array of strings in the `additionalSegmentWidgetNames` property. The widgets need to be defined in the survey and will be added after the mode questions (#1345). It also includes the option to ask who was driving a vehicle, with the `askSegmentDriver` boolean option (fixes [#1434](https://github.com/chairemobilite/evolution/issues/1434)).
- Segment section configuration can set an array of fields representing geolocalization by setting the `fieldsWithGeojsonPoint` property. (fixes [#1603](https://github.com/chairemobilite/evolution/issues/1603)).
- Added various builtin audit checks: home in survey area, survey contactEmail and helpContactEmail validation, missing home, mismatched household members and declared count, missing or invalid vehicle count
- Audit check `I_M_ContactEmailButWouldLikeToParticipateInOtherSurveys`: flags interviews where the respondent would like to participate in other surveys but did not provide a contact email (ported from od_mtl_2023's v1 `I_M_ContactEmailButAcceptedToBeContacted`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should regroup all Audit check addition in the same changelog entry.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The audit checks will be removed from the changelog, as explained in #1727

Should I just remove it from this PR too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the changelog, would have been removed anyway in #1727

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tahini asked me to not put the audit checks in changelogs anyway

…heck

Flags interviews where the respondent would like to participate in
other surveys (wouldLikeToParticipateInOtherSurveys) but did not
provide a contact email. Ports od_mtl_2023's v1 check
I_M_ContactEmailButAcceptedToBeContacted, which was dropped in v2
with no replacement.

Test coverage includes the case where a contact email is present but
the respondent opted out of participating in other surveys.
@kaligrafy
kaligrafy force-pushed the auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp branch from add8b8b to c3a7633 Compare July 16, 2026 19:31
@kaligrafy
kaligrafy requested a review from greenscientist July 16, 2026 19:33
@kaligrafy
kaligrafy merged commit fbb6258 into chairemobilite:main Jul 17, 2026
6 checks passed
@kaligrafy
kaligrafy deleted the auditCheck_I_M_contactEmailButAcceptedToBeContactedForHelp branch July 17, 2026 20:39
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.

2 participants