Skip to content

Change DMARC reporting template#11

Merged
LukeSteward merged 3 commits into
mainfrom
dwos-template-change
May 15, 2026
Merged

Change DMARC reporting template#11
LukeSteward merged 3 commits into
mainfrom
dwos-template-change

Conversation

@LukeSteward
Copy link
Copy Markdown
Owner

@LukeSteward LukeSteward commented May 15, 2026

  • Updated the modal to request the organization name instead of the company name for DMARC submissions.
  • Enhanced URL parameters for new issue creation to include DMARC record snippets and issue types.

Summary

Adjusted the URL used to fill out the repo's template

How tested

Manual testing in Chrome and Edge confirm this is working

Checklist

  • npm test passes locally
  • If package.json / package-lock.json changed and this repo commits SBOMs: updated sbom-cyclonedx-npm.json and sbom.spdx.json
  • No new network hosts or permissions without updating wxt.config.ts manifest and docs (README / privacy notes) as needed

Summary by CodeRabbit

  • New Features

    • DMARC "Wall of Shame" submissions now open a prefilled web issue with the domain, organization, DMARC lookup link, and formatted record snippet.
  • Bug Fixes

    • Standardized terminology from "company" to "organisation" in the DMARC submission modal and validation messages.
  • Tests

    • Added comprehensive tests for DMARC record processing, formatting, issue-type inference, and prefilled issue URL generation.

Review Change Stack

- Introduced functions to analyze DMARC records and generate issue links for the Wall of Shame.
- Updated the modal to request the organization name instead of the company name for DMARC submissions.
- Enhanced URL parameters for new issue creation to include DMARC record snippets and issue types.
- Removed deprecated functions related to DMARC issue reporting.
- Introduced a new function to build the Wall of Shame DMARC issue URL.
- Updated the modal to utilize the new URL building function for issue submissions.
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 15, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9608fb37-2b78-4fd9-8689-e33de299e968

📥 Commits

Reviewing files that changed from the base of the PR and between 7072e67 and 2951fb9.

📒 Files selected for processing (2)
  • lib/wallOfShameDmarcIssue.test.ts
  • lib/wallOfShameDmarcIssue.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/wallOfShameDmarcIssue.test.ts
  • lib/wallOfShameDmarcIssue.ts

📝 Walkthrough

Walkthrough

Adds a library to build prefilled GitHub "Wall of Shame" DMARC issue URLs with helpers/tests, and updates the popup to import and use that library while changing modal text to use "organisation" phrasing.

Changes

DMARC Wall of Shame Issue URL Library

Layer / File(s) Summary
DMARC issue URL library: contracts, logic, and tests
lib/wallOfShameDmarcIssue.ts, lib/wallOfShameDmarcIssue.test.ts
Module constants and helpers (URL truncation, mxtoolboxDmarcLookupUrl, inferWallOfShameDmarcIssueType, formatWallOfShameDmarcRecordForUrl, buildWallOfShameDmarcIssueUrl) construct prefilled GitHub issue URLs; tests validate URL/query params, encoding, issue-type inference, record formatting, truncation, multi-record handling, and edge cases.
Popup integration with DMARC URL library
entrypoints/popup/main.ts
Import buildWallOfShameDmarcIssueUrl, remove inline WALL_OF_SHAME_REPO/wallOfShameNewIssueUrl, change modal copy to "organisation" wording, and call the library to build/open the issue URL on submit.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hop, I code, I tidy the fray,
Prefilled issues to send away.
Organisation names snug in the URL,
DMARC records trimmed to fit well.
Tests hum softly — all is okay.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Change DMARC reporting template' directly reflects the main objective of updating the DMARC reporting workflow, including template changes and URL parameter enhancements.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dwos-template-change

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
lib/wallOfShameDmarcIssue.test.ts (1)

82-97: ⚡ Quick win

Add boundary tests for maxChars <= 1 truncation behavior.

Current truncation coverage misses the edge bounds where maxChars is 0 or 1, which is where regressions are most likely.

✅ Proposed test additions
 describe('formatWallOfShameDmarcRecordForUrl', () => {
+  it('returns empty for maxChars=0', () => {
+    expect(formatWallOfShameDmarcRecordForUrl(['v=DMARC1; p=none;'], 0)).toBe('');
+  });
+
+  it('returns only ellipsis for maxChars=1 when input is non-empty', () => {
+    expect(formatWallOfShameDmarcRecordForUrl(['v=DMARC1; p=none;'], 1)).toBe('…');
+  });
+
   it('truncates long records with an ellipsis suffix', () => {
🤖 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 `@lib/wallOfShameDmarcIssue.test.ts` around lines 82 - 97, Add boundary unit
tests for formatWallOfShameDmarcRecordForUrl to cover maxChars values 0 and 1:
create two new it blocks in lib/wallOfShameDmarcIssue.test.ts that call
formatWallOfShameDmarcRecordForUrl with a long DMARC record and maxChars set to
0 and 1 respectively, then assert the output length equals the given max (0 or
1), and verify truncation/ellipsis behavior for the 1 case (endsWith '…') and
appropriate handling for 0 (empty string). Ensure you reference
formatWallOfShameDmarcRecordForUrl and WALL_OF_SHAME_DMARC_RECORD_URL_MAX in the
tests to keep behavior consistent with existing cases.
🤖 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 `@lib/wallOfShameDmarcIssue.ts`:
- Around line 9-13: The truncation function truncateForUrlSnippet can call slice
with a negative bound when max <= 0; update truncateForUrlSnippet to guard
non-positive max (e.g., if max <= 0 return '' and handle max === 1 as a special
case if you want a single ellipsis) so you never call slice with a negative
length and the returned string respects the requested max; make the same
guard/update in formatWallOfShameDmarcRecordForUrl (and the related snippet
logic referenced around lines 38–47) so both use the safe truncation behavior.

---

Nitpick comments:
In `@lib/wallOfShameDmarcIssue.test.ts`:
- Around line 82-97: Add boundary unit tests for
formatWallOfShameDmarcRecordForUrl to cover maxChars values 0 and 1: create two
new it blocks in lib/wallOfShameDmarcIssue.test.ts that call
formatWallOfShameDmarcRecordForUrl with a long DMARC record and maxChars set to
0 and 1 respectively, then assert the output length equals the given max (0 or
1), and verify truncation/ellipsis behavior for the 1 case (endsWith '…') and
appropriate handling for 0 (empty string). Ensure you reference
formatWallOfShameDmarcRecordForUrl and WALL_OF_SHAME_DMARC_RECORD_URL_MAX in the
tests to keep behavior consistent with existing cases.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 71b6ef44-e539-4ee7-84cc-6fa702b979e8

📥 Commits

Reviewing files that changed from the base of the PR and between 22e9caa and 7072e67.

📒 Files selected for processing (3)
  • entrypoints/popup/main.ts
  • lib/wallOfShameDmarcIssue.test.ts
  • lib/wallOfShameDmarcIssue.ts

Comment thread lib/wallOfShameDmarcIssue.ts
- Updated the inferWallOfShameDmarcIssueType function to correctly identify valid strict DMARC policies.
- Added new test cases for valid strict policies and edge cases in URL formatting.
- Implemented handling for non-positive maxChars in formatWallOfShameDmarcRecordForUrl function.
@LukeSteward LukeSteward merged commit 39edd4c into main May 15, 2026
6 checks passed
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