Skip to content

[ACP2E-4995] normalizeHeader() strips hyphens — year ranges like 2024-2026 may cause false copyright mismatch in CI #40845

@kapil971390

Description

@kapil971390

Hi team

While reviewing the recent changes in ACP2E-4995 (.github/scripts/check_copyright_pr.php), I noticed a normalization behavior that may be worth validating.

Observation

The normalizeHeader() implementation removes hyphens during comparison:

return strtolower((string) preg_replace('/[\s#/*-<>!?[]]+/', '', $text));

This means copyright headers containing year ranges such as:

Copyright © 2024-2026 Adobe

are normalized differently than headers that use a single year format.

Question

Can maintainers confirm that:

  • buildExpectedHeader()
  • extractCopyrightBlock()

always produce equivalent normalized output for valid copyright formats, including year ranges such as 2024-2026?

Suggested Verification

  1. Create a file containing:

Copyright © 2024-2026 Adobe
All Rights Reserved.

  1. Modify the file in a PR without changing the copyright block.

  2. Run check_copyright_pr.php.

  3. Verify the existing-file validation path does not incorrectly report a copyright mismatch.

Potential Impact

If different valid copyright formats normalize differently between the expected-header path and extracted-header path, CI could reject valid PRs with a copyright validation error.

Diff analyzed: 9c5a46f9b09c80

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: ready for confirmationReported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions