Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lirantal
Copy link
Owner

@lirantal lirantal commented Aug 30, 2025

User description

This PR addresses issue #368 by:

  • Unifying the formatting of all Marshall result messages to use ':' as the separator for consistency.
  • Updating all related test expectations to match the new format.
  • Ensuring edge cases and all message variants (including 'consider waiting for community review') are covered.
  • Running lint and all tests to verify correctness.

All tests pass and the code is ready for review.


PR Type

Enhancement


Description

  • Unify Marshall result message formatting with colon separators

  • Update error messages for consistency across all marshalls

  • Standardize warning message punctuation and capitalization

  • Fix typo in downloads marshall warning message


Diagram Walkthrough

flowchart LR
  A["Marshall Messages"] --> B["Age Marshall"]
  A --> C["Version Maturity Marshall"]
  A --> D["Downloads Marshall"]
  B --> E["Colon Separator Format"]
  C --> E
  D --> E
  E --> F["Consistent Error Messages"]
Loading

File Walkthrough

Relevant files
Tests
marshalls.age.test.js
Update age marshall test expectations                                       

tests/marshalls.age.test.js

  • Update test expectations for newly published package messages
  • Change format from parentheses to colon separator
  • Update old package detection message format
  • Maintain test coverage for all age-related scenarios
+7/-7     
marshalls.version-maturity.test.js
Update version maturity test expectations                               

tests/marshalls.version-maturity.test.js

  • Update test expectations for recently published version messages
  • Change format to use colon separator and proper punctuation
  • Standardize capitalization in community review message
+4/-4     
Enhancement
age.marshall.js
Standardize age marshall error messages                                   

lib/marshalls/age.marshall.js

  • Update newly published package error message format
  • Change old package warning message to use colon separator
  • Maintain same validation logic with improved messaging
+2/-2     
version-maturity.marshall.js
Standardize version maturity error messages                           

lib/marshalls/version-maturity.marshall.js

  • Update recently published version error message format
  • Change to colon separator and proper sentence structure
  • Capitalize "Consider" and add proper punctuation
+1/-1     
Bug fix
downloads.marshall.js
Fix downloads marshall message formatting                               

lib/marshalls/downloads.marshall.js

  • Update low download count error message format
  • Fix typo in warning message ("relatively low" instead of "low
    relatively low")
  • Standardize message format with colon separators
+2/-2     
Documentation
github-issue-impl.prompt.md
Add GitHub issue implementation prompt                                     

.github/prompts/github-issue-impl.prompt.md

  • Add new GitHub agent prompt template
  • Define guidelines for implementing GitHub issues
  • Include Git workflow and commit message standards
+22/-0   

@codecov
Copy link

codecov bot commented Aug 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.78%. Comparing base (3dc1588) to head (2837d6a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #371   +/-   ##
=======================================
  Coverage   86.78%   86.78%           
=======================================
  Files          25       25           
  Lines        1097     1097           
  Branches      235      235           
=======================================
  Hits          952      952           
  Misses        127      127           
  Partials       18       18           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qodo-merge-for-open-source
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

368 - PR Code Verified

Compliant requirements:

  • Unify all Marshall result messages to use ':' as the separator instead of '-' or parentheses.
  • Ensure consistent structure, punctuation, and capitalization across messages.
  • Apply consistency to Supply Chain Security (recently published version) and Malware Detection style (colon-based).
  • Update/align tests to reflect the new standardized message format.

Requires further human verification:

  • Confirm no other marshal messages elsewhere in the codebase still use the old format (manual grep/review).
  • Validate CLI/user-facing output rendering is consistent across all execution paths (manual run).
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Tone/Severity

The new message adds "Act carefully" with capitalization and punctuation; confirm this wording and tone match product guidelines and existing marshall messages.

if (dateDiff < thresholdMs) {
  throw new Error(
    `Detected a newly published package: created < ${PACKAGE_AGE_THRESHOLD} days. Act carefully`
  )
Wording Consistency

Verify "Detected a relatively low download-count package" matches desired phrasing and hyphenation across all messages.

throw new Warning(
  `Detected a relatively low download-count package: ${downloadCount} downloads last month`
)
Consistent Periods

Error ends with a period; ensure all other marshall messages either consistently end with a period or follow the same convention.

throw new Error(
  `Detected a recently published version: published ${timeAgoNumber} ${timeAgoText} ago. Consider waiting for community review.`
)

@qodo-merge-for-open-source
Copy link
Contributor

qodo-merge-for-open-source bot commented Aug 30, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Fix time unit pluralization

The updated messages still produce grammatically incorrect time phrases (e.g.,
"created 1 years ago", and potentially "1 hours"). Since this PR focuses on
message consistency, add singular/plural handling for hours/days/years across
marshalls to ensure correct, polished user-facing output. This avoids awkward
wording and improves clarity without changing behavior.

Examples:

lib/marshalls/age.marshall.js [57-60]
    if (versionDateDiffInDays >= 365) {
      timeAgoText = 'years'
      timeAgoNumber = Math.floor(versionDateDiffInDays / 365)
    }
lib/marshalls/version-maturity.marshall.js [45-48]
      if (versionDateDiffInDays === 0) {
        timeAgoText = 'hours'
        const versionDateDiffInHours = Math.round(versionDateDiff / (1000 * 60 * 60))
        timeAgoNumber = versionDateDiffInHours

Solution Walkthrough:

Before:

// in age.marshall.js
if (versionDateDiffInDays >= 365) {
  timeAgoText = 'years';
  timeAgoNumber = Math.floor(versionDateDiffInDays / 365);
}
throw new Warning(`... created ${timeAgoNumber} ${timeAgoText} ago`);
// Potential output: "... created 1 years ago"

// in version-maturity.marshall.js
if (versionDateDiffInDays === 0) {
  timeAgoText = 'hours';
  timeAgoNumber = Math.round(versionDateDiff / (1000 * 60 * 60));
}
throw new Error(`... published ${timeAgoNumber} ${timeAgoText} ago...`);
// Potential output: "... published 1 hours ago..."

After:

// in age.marshall.js
if (versionDateDiffInDays >= 365) {
  timeAgoNumber = Math.floor(versionDateDiffInDays / 365);
  timeAgoText = timeAgoNumber === 1 ? 'year' : 'years';
}
throw new Warning(`... created ${timeAgoNumber} ${timeAgoText} ago`);
// Correct output: "... created 1 year ago"

// in version-maturity.marshall.js
if (versionDateDiffInDays === 0) {
  timeAgoNumber = Math.round(versionDateDiff / (1000 * 60 * 60));
  timeAgoText = timeAgoNumber === 1 ? 'hour' : 'hours';
}
throw new Error(`... published ${timeAgoNumber} ${timeAgoText} ago...`);
// Correct output: "... published 1 hour ago..."
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a grammatical flaw in user-facing messages across multiple marshalls (age.marshall.js, version-maturity.marshall.js), and fixing it directly aligns with the PR's goal of improving message consistency and quality.

Medium
  • Update

@lirantal lirantal self-assigned this Aug 30, 2025
@lirantal lirantal merged commit 18e91cf into main Aug 30, 2025
15 checks passed
@lirantal lirantal deleted the feat/issue-368-format-marshalls branch August 30, 2025 12:33
@github-actions
Copy link

🎉 This PR is included in version 3.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants