Skip to content

feat: ask legacy slack members to accept the code of conduct - #170

Merged
jaspermayone merged 3 commits into
mainfrom
feature-coc-reaccept
Oct 9, 2026
Merged

jaspermayone merged 3 commits into
mainfrom
feature-coc-reaccept

Conversation

@jaspermayone

@jaspermayone jaspermayone commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Members who joined the Slack before the code-of-conduct flow are full members with no slack_coc_accepted_at. Nothing asked them to accept. Many of them also have the placeholder name NOTSET from the Slack import.

This PR asks them to accept, by Slack DM and by email, and collects a missing name at the same time.

flowchart TD
  A[bin/rails slack:coc:request SEND=1] --> B[CodeOfConductRequestJob]
  B --> C[Slack DM]
  B --> D[Email: sign in to Weave]
  C -->|name known| E[accept_coc button]
  C -->|name missing| F[open_coc_form button: Slack form with name fields]
  D --> G[/slack accept step with name fields/]
  E --> H[SlackCodeOfConductAcceptedJob]
  F --> I[CodeOfConductAcceptance]
  G --> I
  I --> H
Loading

Changes

  • User#slack_onboarding_step returns :accept_code_of_conduct for a full member without an acceptance. / and the profile banner send them to /slack.
  • New User.code_of_conduct_pending and User.name_missing scopes, and User#name_missing? (NOTSET, Unknown, User).
  • New CodeOfConductAcceptance service records the acceptance and a missing name. The /slack page and the Slack form both use it.
  • The Slack DM and the Slack form are plain Block Kit payloads, built in CodeOfConductSlackViews. The DM has a header, the message paragraphs, a "Read it" button for the Code of Conduct, the accept button, and a link to /slack.
  • The DM can open a Slack form (views.open). The form has a required "I have read and accept the Code of Conduct" box and a note on how we use the data. The submission uses the submitting Slack user, never a value from the form.
  • When the name is missing, the form asks for:
    • a preferred first and last name (required): what Weave and apps show,
    • a legal first and last name (optional, only if different): stored in legal_first_name / legal_last_name, never sent to apps,
    • a Slack nickname (optional). PushSlackNameJob sets only the Slack display name when there is a nickname, so the preferred name stays out of Slack. Without one, it sets the Slack first and last name to the preferred name.
  • The /slack accept step has the same box (required, checked on the server), the same name fields and hints, and the same data-use note. The text is in config/locales/code_of_conduct_form.en.yml.
  • SlackCodeOfConductAcceptedJob does not promote someone who is already a full member. It replaces the DM when it gets the message reference.
  • New CodeOfConductRequestJob sends the DM and the email, and sets the new slack_coc_requested_at column.
  • The message text is in config/locales/code_of_conduct_request.en.yml.
  • New rake tasks: slack:coc:status and slack:coc:request (preview unless SEND=1; DEADLINE=, REMIND=1).

Test plan

  • bundle exec rspec
  • bin/rails test
  • bin/rubocop, bin/brakeman
  • On staging: send one request to a test account. Check the DM, the Slack form, the email and /slack.

This PR has a migration.

@jaspermayone
jaspermayone added this pull request to stack #173 October 9, 2026 16:33
@jaspermayone jaspermayone added the migration Includes database migrations label Oct 9, 2026
@jaspermayone
jaspermayone marked this pull request as ready for review October 9, 2026 17:59
@jaspermayone
jaspermayone merged commit eb69448 into main Oct 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration Includes database migrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant