Skip to content

wheels upgrade: underscore-flag pre-check scope-asymmetry with advisory #2 #2808

Description

@bpamiri

Spun off from PR #2807 (Reviewer A round-3 non-blocking nit).

Problem

In `cli/lucli/Module.cfc::runUpgradeCheck()`, the advisory-1 suppression guard reads only `config/settings.cfm`:

```cfm
var settingsFile = variables.projectRoot & "/config/settings.cfm";
if (fileExists(settingsFile)) {
underscoreFlagAlreadySet = reFindNoCase(
"useUnderscoreReferenceColumns\s*=\s*true",
stripCfmlComments(fileRead(settingsFile))
) > 0;
}
```

But advisory #2 scans all of `config/` for the same pattern:

```cfm
arrayAppend(checks, {
description: "useUnderscoreReferenceColumns=true is set — confirm legacy migrations don't conflict",
severity: "advisory",
pattern: "useUnderscoreReferenceColumns\s*=\s*true",
scanDir: "config",
extensions: "cfm,cfc",
...
});
```

Impact

If a user sets the flag in an environment-specific override file (e.g., `config/production/settings.cfm`, `config/development/settings.cfm`), the pre-check on the root `settings.cfm` will return false, advisory #1 will fire ("opt into the flag!"), AND advisory #2 will also fire ("the flag is set!"). Same contradiction the round-1 fix was trying to prevent.

Low impact because:

  1. Per-environment flag overrides for this setting are unusual
  2. Both advisories are `severity: "advisory"` — they never gate CI

Suggested fix

Expand the pre-check to scan all of `config/` recursively (matching advisory #2's scope), not just the root `settings.cfm`. Existing helper pattern at `Module.cfc:3995` (the grep loop) shows how to do recursive scanning.

Alternatively: simplify by letting the bucketing handle the contradiction — e.g., if advisory #2 fires, suppress advisory #1 even if its guard didn't catch the flag.

Good first issue for someone wanting to touch the CLI without a deep dive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions