Skip to content

Stabilize failing GitHub workflows and align repo tooling - #27

Open
MaximillianGroup with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-tooling-and-workflows
Open

Stabilize failing GitHub workflows and align repo tooling#27
MaximillianGroup with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-tooling-and-workflows

Conversation

Copilot AI commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The repository’s automation had drifted from the current codebase and platform assumptions, causing multiple workflows to fail for unrelated reasons. This PR brings the workflow configuration, local env setup, and build validation back into sync with the repository’s actual runtime and asset layout.

  • Workflow/runtime alignment

    • update wp-env and workflow WordPress refs to match the repo’s current 6.9+ baseline
    • stop the CI compliance check from asserting the obsolete 6.4 requirement
    • make workflow shutdown tolerant when wp-env start fails, so teardown does not mask the primary error
  • Build/release validation fixes

    • update the release/build validator to check the real recorder stylesheet source (src/css/starmus-audio-recorder.css) instead of a removed legacy filename
    • preserve release workflow behavior while removing a known false failure condition in the prebuild validation path
  • EthicalCheck workflow repair

    • replace the missing apisec-inc/ethicalcheck-action dependency with the maintained APIsec action
    • gate execution on explicit repository configuration (APISEC_BASE_URL, APISEC_SPECIFICATION_PATH, APISECU_TOKEN) so the workflow skips cleanly when not configured instead of failing at action resolution time
  • CI-surfaced code fixes

    • apply the JS formatting corrections that were failing the frontend lint workflow
    • refactor R2 endpoint constant loading to satisfy static analysis without weakening the required-value check
# before
- uses: apisec-inc/ethicalcheck-action@...
  with:
    oas-url: "http://netbanking.apisec.ai:8080/v2/api-docs"

# after
- name: Validate EthicalCheck configuration
  id: config
  run: |
    if [ -z "${APISEC_BASE_URL}" ] || [ -z "${APISEC_SPECIFICATION_PATH}" ] || [ -z "${APISECU_TOKEN}" ]; then
      echo "configured=false" >> "${GITHUB_OUTPUT}"
      exit 0
    fi

- uses: apisec-university/free-API-security-test-action@beta
  if: steps.config.outputs.configured == 'true'
  with:
    base_url: ${{ env.APISEC_BASE_URL }}
    specification_path: ${{ env.APISEC_SPECIFICATION_PATH }}
    apisecu_token: ${{ env.APISECU_TOKEN }}

Copilot AI requested review from Copilot and removed request for Copilot June 7, 2026 03:11
Copilot AI changed the title Fix broken tooling and workflow configuration Stabilize failing GitHub workflows and align repo tooling Jun 7, 2026
Copilot AI requested a review from MaximillianGroup June 7, 2026 03:12

- name: Run APIsec scan
if: steps.config.outputs.configured == 'true'
uses: apisec-university/free-API-security-test-action@beta
@MaximillianGroup
MaximillianGroup marked this pull request as ready for review September 6, 2026 21:25
Copilot AI lite review requested due to automatic review settings September 6, 2026 21:25
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Stabilize workflows and align WordPress tooling

🐞 Bug fix ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Align WordPress CI and local wp-env baselines to 6.9 and trunk.
• Repair optional APIsec scans and prevent teardown errors from masking test failures.
• Correct build asset validation, frontend formatting, and R2 endpoint resolution.
Diagram

graph TD
  A["GitHub triggers"] --> B["Workflow jobs"] --> C{"Validation route"}
  C --> D["WordPress 6.9"] --> E["wp-env tests"]
  C --> F["Build validator"] --> G["Source assets"]
  C --> H["APIsec scan"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin the maintained APIsec action
  • ➕ Makes security scans reproducible across workflow runs.
  • ➕ Reduces supply-chain exposure from a mutable beta reference.
  • ➕ Matches the repository's existing practice for sensitive third-party actions.
  • ➖ Requires periodic manual updates to receive APIsec fixes.
  • ➖ Needs verification of a supported commit SHA.

Recommendation: Keep the PR's configuration-gated workflow and centralized R2 constant helper; both directly address the observed failures without weakening validation. Before merging, prefer pinning the maintained APIsec action to a reviewed commit SHA instead of the mutable beta reference.

Files changed (11) +241 / -224

Bug fix (2) +23 / -10
validate-build.cjsValidate the current recorder stylesheet +1/-1

Validate the current recorder stylesheet

• Replaces the removed legacy stylesheet path with 'src/css/starmus-audio-recorder.css', preventing false prebuild validation failures.

scripts/validate-build.cjs

StarmusR2DirectService.phpCentralize required R2 endpoint resolution +22/-9

Centralize required R2 endpoint resolution

• Moves dynamic constant lookup and validation into a reusable helper that rejects undefined, non-scalar, or empty values. The resolved endpoint retains its exact scalar value after string conversion while avoiding static-analysis issues.

src/services/StarmusR2DirectService.php

Other (9) +218 / -214
ci.ymlAlign CI compliance and teardown behavior +2/-2

Align CI compliance and teardown behavior

• Updates the compliance check from WordPress 6.4 to 6.9. Makes the invoked wp-env shutdown command non-blocking so teardown errors do not replace the primary result.

.github/workflows/ci.yml

ethicalcheck.ymlRepair and gate APIsec security scanning +31/-27

Repair and gate APIsec security scanning

• Replaces the unavailable EthicalCheck action with the maintained APIsec action and limits execution to scheduled or manual runs. The job validates repository variables, the API token, and the specification file before conditionally starting a scan; obsolete SARIF upload permissions and steps are removed.

.github/workflows/ethicalcheck.yml

test.ymlTest WordPress 6.9 and trunk +2/-2

Test WordPress 6.9 and trunk

• Moves the WordPress matrix from 6.8/latest to 6.9/trunk. Keeps the always-run teardown step from failing the workflow when wp-env cannot stop cleanly.

.github/workflows/test.yml

.wp-env.jsonSet the local WordPress baseline to 6.9 +1/-1

Set the local WordPress baseline to 6.9

• Updates the default wp-env core reference from WordPress 6.4 to 6.9, matching CI and the plugin's current compatibility baseline.

.wp-env.json

starmus-core.jsNormalize calibration metadata formatting +3/-3

Normalize calibration metadata formatting

• Reindents the conditional calibration object to satisfy the configured JavaScript formatter without changing behavior.

src/js/starmus-core.js

starmus-enhanced-calibration.jsNormalize calibration switch formatting +21/-21

Normalize calibration switch formatting

• Aligns switch cases with the repository's linting rules while preserving every calibration phase and message.

src/js/starmus-enhanced-calibration.js

starmus-metadata-auto.jsNormalize automatic metadata formatting +4/-4

Normalize automatic metadata formatting

• Reindents the conditional calibration metadata object to resolve frontend formatting failures without semantic changes.

src/js/starmus-metadata-auto.js

starmus-recorder.jsNormalize language switch formatting +8/-8

Normalize language switch formatting

• Aligns country switch cases with the lint configuration while retaining existing English and French language selection behavior.

src/js/starmus-recorder.js

starmus-state-store.jsNormalize reducer switch formatting +146/-146

Normalize reducer switch formatting

• Reindents reducer cases and nested state payloads to satisfy frontend linting. State transitions and reducer behavior remain unchanged.

src/js/starmus-state-store.js

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (3) 📜 Skill insights (0)

Grey Divider


Action required

1. A mutable action can expose scan secrets 🐞 Bug ⛨ Security
Description
The Run APIsec scan step references the third-party action through the movable beta tag while
passing it APISECU_TOKEN. If that tag is moved or its repository is compromised, scheduled and
manually dispatched jobs execute the replacement code with the APIsec credential and read access to
the repository.
Code

.github/workflows/ethicalcheck.yml[69]

+        uses: apisec-university/free-API-security-test-action@beta
Evidence
The workflow passes the repository's APIsec secret to an action selected by a mutable tag, whereas
GitHub documents a full-length commit SHA as the only immutable action reference. The repository
also pins several other third-party actions by full SHA, including PHP setup and pnpm setup.

.github/workflows/ethicalcheck.yml[42-45]
.github/workflows/ethicalcheck.yml[67-73]
.github/workflows/test.yml[25-33]
🌐 GitHub states that pinning an action to a full-length commit SHA is the only way to use it as an immutable release and mitigates backdoor risk.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The APIsec workflow invokes a third-party action through the mutable `beta` tag while exposing `APISECU_TOKEN` to that action. Pin the action to a reviewed full-length commit SHA so later tag movement cannot silently change the code that receives the credential.

## Issue Context
The replaced EthicalCheck action was pinned to a full commit SHA, and other third-party workflows in this repository follow the same pattern. Preserve the action inputs and configuration gate while replacing only the mutable reference.

## Fix Focus Areas
- .github/workflows/ethicalcheck.yml[67-73]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Maintainers inherit conflicting styles 📘 Rule violation ⚙ Maintainability
Description
getRequiredStringConstant() uses a camelCase method name and a PSR-style next-line opening brace
in WordPress-integrated source, with no inline waiver. When the repository's WordPress naming and
core rules scan src/, this newly added helper conflicts with the preferred style and gives later
additions two conventions to follow.
Code

src/services/StarmusR2DirectService.php[R296-297]

+    private function getRequiredStringConstant(string $constant_name): string
+    {
Evidence
Compliance rule 2921495 requires WordPress conventions to prevail over conflicting PSR conventions.
The new helper uses camelCase and PSR brace placement, while the repository ruleset applies
WordPress Core, Extra, Docs, VIP Minimum, and naming checks to src/.

Rule 2921495: Prefer WordPress coding standards when they conflict with PSR-1/4/12
src/services/StarmusR2DirectService.php[296-297]
phpcs.xml[12-15]
phpcs.xml[49-54]
phpcs.xml[76-88]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new helper follows PSR naming and brace placement instead of the repository's preferred WordPress coding style.

## Issue Context
Rename the helper and its call site using WordPress snake_case, and place the opening brace according to the applicable WordPress standard. Update any references consistently.

## Fix Focus Areas
- src/services/StarmusR2DirectService.php[249-249]
- src/services/StarmusR2DirectService.php[296-315]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. PHP changes can merge without tests 📘 Rule violation ▣ Testability
Description
getRequiredStringConstant() adds validation behavior, but the changed workflows run PHP static
analysis and WordPress activation or end-to-end checks without invoking the configured PHPUnit
suite. When endpoint constants are undefined, non-scalar, or empty, no required CI job exercises
those branches, so a regression in the new helper can merge undetected.
Code

src/services/StarmusR2DirectService.php[R298-301]

+        if (! \defined($constant_name)) {
+            throw new RuntimeException(\sprintf('%s is not defined or is empty.', $constant_name));
+        }
+
Evidence
Compliance rule 2922637 requires both PHP tests and static analysis for all changes. CI invokes
PHPStan, while the test matrix invokes WordPress activation and browser tests; although
composer.json defines a PHPUnit unit-test command, neither changed workflow runs it for the new
helper.

Rule 2922637: Run PHP unit tests and static analyzers for all changes
src/services/StarmusR2DirectService.php[296-315]
.github/workflows/ci.yml[66-72]
.github/workflows/test.yml[41-57]
composer.json[93-106]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR adds PHP validation branches without a required CI invocation of the configured PHPUnit suite.

## Issue Context
Add a blocking PHP unit-test step and cover undefined, non-scalar, empty, and valid string constants. Keep the existing static-analysis step blocking.

## Fix Focus Areas
- src/services/StarmusR2DirectService.php[296-315]
- .github/workflows/ci.yml[66-72]
- .github/workflows/test.yml[41-57]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Reviewers must assess unrelated fixes 📘 Rule violation ⚙ Maintainability
Description
The PR combines workflow runtime changes, an API security action replacement, build-validator
repair, broad JavaScript formatting, and an R2 constant-loading refactor in one change set. Because
the workflow, validator, formatting, and PHP groups can be removed independently without making the
others incoherent, reviewers must validate several unrelated failure modes together.
Code

src/services/StarmusR2DirectService.php[249]

+        $r2_endpoint = $this->getRequiredStringConstant('STARMUS_R2_ENDPOINT');
Evidence
Compliance rule 2924177 requires a single coherent feature or bug-fix change set. The cited files
demonstrate independent changes to CI baselines, security scanning, build asset validation,
JavaScript formatting, and PHP constant resolution.

Rule 2924177: Limit pull request to a single feature or bug fix change set
.github/workflows/ci.yml[60-63]
.github/workflows/ethicalcheck.yml[51-73]
scripts/validate-build.cjs[6-10]
src/js/starmus-enhanced-calibration.js[216-242]
src/services/StarmusR2DirectService.php[249-249]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The pull request contains several independently removable fixes rather than one feature or bug-fix change set.

## Issue Context
Separate workflow/runtime repair, APIsec workflow replacement, build validation, formatting-only changes, and PHP constant handling into focused pull requests with their relevant tests.

## Fix Focus Areas
- .github/workflows/ci.yml[60-63]
- .github/workflows/ethicalcheck.yml[51-73]
- scripts/validate-build.cjs[6-10]
- src/services/StarmusR2DirectService.php[249-249]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
5. Merges skip API security scans 🐞 Bug ⛨ Security
Description
The workflow's on block removes the push and pull_request events and retains only a weekly
schedule and manual dispatch. Even when all three APIsec settings are configured, API changes can
therefore enter the main branch without invoking this scan and are examined only during a later
scheduled run.
Code

.github/workflows/ethicalcheck.yml[L35-38]

-  push:
-    branches: [ "main" ]
-  pull_request:
-    branches: [ "main" ]
Evidence
The old trigger block explicitly covered pushes and pull requests to main, while the resulting
workflow exposes only a Tuesday schedule and manual dispatch. The scan step's configuration
condition does not add any event-based execution.

.github/workflows/ethicalcheck.yml[31-34]
.github/workflows/ethicalcheck.yml[51-69]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The repaired API security workflow no longer runs on pushes or pull requests because both event triggers were removed. Restore appropriate change-triggered execution while retaining the existing configuration gate so unconfigured repositories and forked pull requests skip cleanly.

## Issue Context
The previous workflow targeted pushes and pull requests to `main`. The new weekly schedule can complement those triggers but does not scan each update before or when it reaches the main branch.

## Fix Focus Areas
- .github/workflows/ethicalcheck.yml[31-34]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 67 rules
✅ Web pages:
  +7 more
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 14/18, lines 465/200; both must reach the floor). Router rationale: This PR combines security-sensitive workflow/action and secret gating changes with runtime PHP behavior and broad state-store edits across many independent sites, creating a high density of subtle, independently missable defects.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +296 to +297
private function getRequiredStringConstant(string $constant_name): string
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. Maintainers inherit conflicting styles 📘 Rule violation ⚙ Maintainability

getRequiredStringConstant() uses a camelCase method name and a PSR-style next-line opening brace
in WordPress-integrated source, with no inline waiver. When the repository's WordPress naming and
core rules scan src/, this newly added helper conflicts with the preferred style and gives later
additions two conventions to follow.
Agent Prompt
## Issue description
The new helper follows PSR naming and brace placement instead of the repository's preferred WordPress coding style.

## Issue Context
Rename the helper and its call site using WordPress snake_case, and place the opening brace according to the applicable WordPress standard. Update any references consistently.

## Fix Focus Areas
- src/services/StarmusR2DirectService.php[249-249]
- src/services/StarmusR2DirectService.php[296-315]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

@copilot - ## Issue description
The new helper follows PSR naming and brace placement instead of the repository's preferred WordPress coding style.

Issue Context

Rename the helper and its call site using WordPress snake_case, and place the opening brace according to the applicable WordPress standard. Update any references consistently.

Fix Focus Areas

  • src/services/StarmusR2DirectService.php[249-249]
  • src/services/StarmusR2DirectService.php[296-315]

Comment on lines +298 to +301
if (! \defined($constant_name)) {
throw new RuntimeException(\sprintf('%s is not defined or is empty.', $constant_name));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Php changes can merge without tests 📘 Rule violation ▣ Testability

getRequiredStringConstant() adds validation behavior, but the changed workflows run PHP static
analysis and WordPress activation or end-to-end checks without invoking the configured PHPUnit
suite. When endpoint constants are undefined, non-scalar, or empty, no required CI job exercises
those branches, so a regression in the new helper can merge undetected.
Agent Prompt
## Issue description
The PR adds PHP validation branches without a required CI invocation of the configured PHPUnit suite.

## Issue Context
Add a blocking PHP unit-test step and cover undefined, non-scalar, empty, and valid string constants. Keep the existing static-analysis step blocking.

## Fix Focus Areas
- src/services/StarmusR2DirectService.php[296-315]
- .github/workflows/ci.yml[66-72]
- .github/workflows/test.yml[41-57]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

@copilot - ## Issue description
The PR adds PHP validation branches without a required CI invocation of the configured PHPUnit suite.

Issue Context

Add a blocking PHP unit-test step and cover undefined, non-scalar, empty, and valid string constants. Keep the existing static-analysis step blocking.

Fix Focus Areas

  • src/services/StarmusR2DirectService.php[296-315]
  • .github/workflows/ci.yml[66-72]
  • .github/workflows/test.yml[41-57]

if ($r2_endpoint === '') {
throw new RuntimeException('STARMUS_R2_ENDPOINT is not defined or is empty.');
}
$r2_endpoint = $this->getRequiredStringConstant('STARMUS_R2_ENDPOINT');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

3. Reviewers must assess unrelated fixes 📘 Rule violation ⚙ Maintainability

The PR combines workflow runtime changes, an API security action replacement, build-validator
repair, broad JavaScript formatting, and an R2 constant-loading refactor in one change set. Because
the workflow, validator, formatting, and PHP groups can be removed independently without making the
others incoherent, reviewers must validate several unrelated failure modes together.
Agent Prompt
## Issue description
The pull request contains several independently removable fixes rather than one feature or bug-fix change set.

## Issue Context
Separate workflow/runtime repair, APIsec workflow replacement, build validation, formatting-only changes, and PHP constant handling into focused pull requests with their relevant tests.

## Fix Focus Areas
- .github/workflows/ci.yml[60-63]
- .github/workflows/ethicalcheck.yml[51-73]
- scripts/validate-build.cjs[6-10]
- src/services/StarmusR2DirectService.php[249-249]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

@copilot - ## Issue description
The pull request contains several independently removable fixes rather than one feature or bug-fix change set.

Issue Context

Separate workflow/runtime repair, APIsec workflow replacement, build validation, formatting-only changes, and PHP constant handling into focused pull requests with their relevant tests.

Fix Focus Areas

  • .github/workflows/ci.yml[60-63]
  • .github/workflows/ethicalcheck.yml[51-73]
  • scripts/validate-build.cjs[6-10]
  • src/services/StarmusR2DirectService.php[249-249]


- name: Run APIsec scan
if: steps.config.outputs.configured == 'true'
uses: apisec-university/free-API-security-test-action@beta

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

4. A mutable action can expose scan secrets 🐞 Bug ⛨ Security

The Run APIsec scan step references the third-party action through the movable beta tag while
passing it APISECU_TOKEN. If that tag is moved or its repository is compromised, scheduled and
manually dispatched jobs execute the replacement code with the APIsec credential and read access to
the repository.
Agent Prompt
## Issue description
The APIsec workflow invokes a third-party action through the mutable `beta` tag while exposing `APISECU_TOKEN` to that action. Pin the action to a reviewed full-length commit SHA so later tag movement cannot silently change the code that receives the credential.

## Issue Context
The replaced EthicalCheck action was pinned to a full commit SHA, and other third-party workflows in this repository follow the same pattern. Preserve the action inputs and configuration gate while replacing only the mutable reference.

## Fix Focus Areas
- .github/workflows/ethicalcheck.yml[67-73]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

@copilot - ## Issue description
The APIsec workflow invokes a third-party action through the mutable beta tag while exposing APISECU_TOKEN to that action. Pin the action to a reviewed full-length commit SHA so later tag movement cannot silently change the code that receives the credential.

Issue Context

The replaced EthicalCheck action was pinned to a full commit SHA, and other third-party workflows in this repository follow the same pattern. Preserve the action inputs and configuration gate while replacing only the mutable reference.

Fix Focus Areas

  • .github/workflows/ethicalcheck.yml[67-73]

Comment on lines -35 to -38
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

5. Merges skip api security scans 🐞 Bug ⛨ Security

The workflow's on block removes the push and pull_request events and retains only a weekly
schedule and manual dispatch. Even when all three APIsec settings are configured, API changes can
therefore enter the main branch without invoking this scan and are examined only during a later
scheduled run.
Agent Prompt
## Issue description
The repaired API security workflow no longer runs on pushes or pull requests because both event triggers were removed. Restore appropriate change-triggered execution while retaining the existing configuration gate so unconfigured repositories and forked pull requests skip cleanly.

## Issue Context
The previous workflow targeted pushes and pull requests to `main`. The new weekly schedule can complement those triggers but does not scan each update before or when it reaches the main branch.

## Fix Focus Areas
- .github/workflows/ethicalcheck.yml[31-34]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

@copilot - ## Issue description
The repaired API security workflow no longer runs on pushes or pull requests because both event triggers were removed. Restore appropriate change-triggered execution while retaining the existing configuration gate so unconfigured repositories and forked pull requests skip cleanly.

Issue Context

The previous workflow targeted pushes and pull requests to main. The new weekly schedule can complement those triggers but does not scan each update before or when it reaches the main branch.

Fix Focus Areas

  • .github/workflows/ethicalcheck.yml[31-34]

@MaximillianGroup

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Copilot AI 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.

🟡 Changes recommended

The EthicalCheck workflow trigger scope and action pinning/stability choices (plus the new PHP constant helper’s type semantics) need adjustment to avoid unintended behavior and CI instability.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR realigns repository automation and tooling with the current WordPress/PHP/asset layout, aiming to eliminate workflow failures caused by outdated assumptions (WP baseline, build validation paths, and missing GitHub Actions dependencies).

Changes:

  • Update CI and local wp-env WordPress baselines to 6.9+, and make wp-env teardown non-blocking so it doesn’t mask primary failures.
  • Repair EthicalCheck workflow by swapping to a maintained APIsec action and adding configuration gating so it can skip cleanly when not configured.
  • Apply CI-surfaced code fixes (JS formatting) and refactor R2 endpoint constant loading for cleaner static-analysis compliance.
File summaries
File Description
src/services/StarmusR2DirectService.php Centralizes required constant resolution for R2 endpoint configuration.
src/js/starmus-state-store.js Formatting-only adjustments to satisfy lint/format checks.
src/js/starmus-recorder.js Formatting-only adjustments to satisfy lint/format checks.
src/js/starmus-metadata-auto.js Formatting-only adjustments to satisfy lint/format checks.
src/js/starmus-enhanced-calibration.js Formatting-only adjustments to satisfy lint/format checks.
src/js/starmus-core.js Formatting-only adjustments to satisfy lint/format checks.
scripts/validate-build.cjs Fixes build validator to check the current recorder stylesheet source path.
.wp-env.json Updates local wp-env core ref to WordPress 6.9.
.github/workflows/test.yml Updates WordPress test matrix and ensures env shutdown doesn’t fail the workflow.
.github/workflows/ethicalcheck.yml Replaces missing action dependency and gates execution on repo configuration.
.github/workflows/ci.yml Updates compliance check to look for WordPress 6.9+ requirement and makes teardown tolerant.
Review details
  • Files reviewed: 6/11 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 31 to 35
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# Customize trigger events based on your DevSecOps processes.
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '37 9 * * 2'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Comment on lines +67 to +70
- name: Run APIsec scan
if: steps.config.outputs.configured == 'true'
uses: apisec-university/free-API-security-test-action@beta
with:
Comment on lines 16 to 20
strategy:
matrix:
php: ["8.2", "8.3", "8.4"]
wordpress: ["6.8", "latest"]
wordpress: ["6.9", "trunk"]

Comment on lines +296 to +315
private function getRequiredStringConstant(string $constant_name): string
{
if (! \defined($constant_name)) {
throw new RuntimeException(\sprintf('%s is not defined or is empty.', $constant_name));
}

$constant_value = \constant($constant_name);

if (! \is_scalar($constant_value)) {
throw new RuntimeException(\sprintf('%s is not defined or is empty.', $constant_name));
}

$resolved_value = (string) $constant_value;

if ($resolved_value === '') {
throw new RuntimeException(\sprintf('%s is not defined or is empty.', $constant_name));
}

return $resolved_value;
}
Copilot AI and others added 2 commits September 6, 2026 21:32
…nd-workflows

# Conflicts:
#	.github/workflows/test.yml
#	src/services/StarmusR2DirectService.php

Co-authored-by: MaximillianGroup <34328348+MaximillianGroup@users.noreply.github.com>
Co-authored-by: MaximillianGroup <34328348+MaximillianGroup@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 6, 2026 21:35

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved. I merged main into this PR branch and fixed the conflicts in commit 48bdf0e (plus follow-up safety fixes in 2acef85).

Copilot AI 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.

🟡 Changes recommended

CI/workflow changes introduce policy/behavior regressions (e.g., WP “trunk” matrix vs stable ceiling, EthicalCheck trigger removal/unpinned action) and a small constant-validation regression that should be corrected before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (3)

.github/workflows/test.yml:19

  • The matrix includes WordPress "trunk", but the repo’s Version Policy states a "current stable ceiling" (AGENTS.md:19). Testing against trunk is likely to reintroduce CI instability due to breaking changes upstream.
        wordpress: ["6.9", "trunk"]

.github/workflows/ethicalcheck.yml:35

  • The PR description describes gating EthicalCheck execution when not configured, but this change also removes push/pull_request triggers entirely. If the intent is still to run scans on PRs (while skipping cleanly when unconfigured), the current workflow won’t run on PRs at all.
on:
  schedule:
    - cron: '37 9 * * 2'
  workflow_dispatch:

.github/workflows/ethicalcheck.yml:73

  • The workflow previously pinned the EthicalCheck action to an immutable commit SHA, but the new APIsec action is referenced as @beta. Using a floating ref increases supply-chain risk and can break CI unexpectedly when the action updates; consider pinning to a specific commit SHA (or a stable, versioned tag) instead.
      - name: Run APIsec scan
        if: steps.config.outputs.configured == 'true'
        uses: apisec-university/free-API-security-test-action@beta
        with:
          base_url: ${{ env.APISEC_BASE_URL }}
          specification_path: ${{ env.APISEC_SPECIFICATION_PATH }}
          apisecu_token: ${{ env.APISECU_TOKEN }}
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +308 to +315
$resolved_value = (string) $constant_value;

if ($resolved_value === '') {
throw new RuntimeException(\sprintf('%s is not defined or is empty.', $constant_name));
}

return $resolved_value;
}

Copy link
Copy Markdown
Contributor

This fixes all four CI failures I documented on Starisian-Technologies/sparxstar-starmus-audio#42. It should merge first.

I filed a standing-down comment on #42 naming four pre-existing failures. Reading this diff, it resolves every one:

Failure I documented Fixed here by
Trigger_EthicalCheckapisec-inc/ethicalcheck-action no longer resolves Replaced with apisec-university/free-API-security-test-action, gated behind config so it no-ops cleanly when unset
wordpress-testswp-env start fails, "Environment not initialized" .wp-env.json core 6.46.9, matching the CI matrix, plus env:stop || true
build — PHPStan identical.alwaysFalse at StarmusR2DirectService.php:255 The getRequiredStringConstant() extraction removes the statically-dead === '' guard
validate-build filename starmus-audio-recorder-style.cssstarmus-audio-recorder.css

Two things worth calling out as better than the minimum:

The EthicalCheck change is the right call. The old workflow was an unmodified GitHub starter template scanning netbanking.apisec.ai — apisec's own public demo API — and mailing the report to xxx@apisec.ai. It never tested this codebase. Gating on real config rather than deleting the check keeps the intent and stops the noise. Dropping the push and pull_request triggers is also correct: an API security scan on every PR was never what it did.

env:stop || true fixes a genuine cascade — the old workflow failed twice, once on start and again on stop against an environment that never came up, so the real error was buried.

One note, not a blocker: the WordPress matrix moves to ["6.9", "trunk"]. Testing against trunk will go red on upstream changes unrelated to this plugin. That is a deliberate tradeoff — worth being sure it is the intended one, since it trades a stable signal for early warning.

This PR is green and every other open PR in this repo is currently red on failures it fixes. Merging it first is the shortest path to a repository where CI means something again.


Generated by Claude Code

MaximillianGroup pushed a commit that referenced this pull request Sep 6, 2026
…ires

`build` fails before any test runs:

    Failed to activate plugin. Current WordPress version (6.4) does not
    meet minimum requirements for Sparxstar Starmus Audio. The plugin
    requires WordPress 6.9.
    Error: No plugins activated.

`starmus-audio-recorder.php` declares `Requires at least: 6.9` while
`.wp-env.json` pinned core to 6.4, so the plugin could never activate in
its own test environment. Not caused by this PR — it is red on main for
the same reason — but #27 already carries this exact one-line fix, and
porting it is cheaper than waiting for that PR to merge. It no-ops once
main has it.

Deliberately not porting #27's EthicalCheck rewrite. That swaps the dead
`apisec-inc/ethicalcheck-action` for a different third-party action, and I
could not verify that the replacement resolves — outbound checks from this
environment return 403 from the proxy, which is not an answer either way.
Shipping an unverified `uses:` into a security workflow is the failure mode
the org rules exist to prevent. #27 authored that change and should carry
it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016cDiLJsQCkPdU4ghzcQSTY
MaximillianGroup added a commit that referenced this pull request Sep 6, 2026
…hat hid it (#42)

Replaces the boundary file's assertion of a hold on ADRs that were not on the
registry's default branch (they are now, via registry#41) with what has
actually moved, what has not, and what each remaining step is blocked on.

Does not build the Spoken Audio Node. The capture->ingestion contract lists
the endpoint path, auth model, metadata key set and error envelope as owed;
writing those for a service that does not exist would produce fabricated
identifiers.

Also ports one line from #27: .wp-env.json pinned WordPress 6.4 while the
plugin header requires 6.9, so the plugin could never activate in its own
test environment. That fix unmasked a second pre-existing failure — the test
script looks for the plugin at wp-content/plugins/starmus-audio-recorder (the
main PHP file's name) while wp-env mounts it under the repository directory
name. Diagnosed on the PR with a proposed patch; not pushed, because it could
not be verified without running Docker.

Merged over three checks that are red on main for reasons unrelated to this
diff: Trigger_EthicalCheck (apisec-inc/ethicalcheck-action no longer
resolves), Lint & Proof Frontend Assets (docs/index.html links to six
generated .html files that are never generated), and the wp-env plugin-slug
mismatch above. None is made worse by this merge; #27 addresses the first.
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.

4 participants