Skip to content

Commit d5f0145

Browse files
committed
Log when repository property has a value but is ignored
1 parent f27f563 commit d5f0145

3 files changed

Lines changed: 26 additions & 16 deletions

File tree

lib/entry-points.js

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config/file.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,9 @@ test("getConfigFileInput ignores repository property value when FF is off", asyn
101101
"Using configuration file input from repository property",
102102
),
103103
);
104+
t.true(
105+
logger.hasMessage(
106+
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
107+
),
108+
);
104109
});

src/config/file.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ export function getConfigFileInput(
2121
return input;
2222
}
2323

24-
// Don't take the repository property into consideration if the FF is not enabled.
25-
if (!useRepositoryProperty) {
26-
return undefined;
27-
}
28-
2924
const propertyValue =
3025
repositoryProperties[RepositoryPropertyName.CONFIG_FILE];
3126

3227
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
33-
logger.info(
34-
`Using configuration file input from repository property: ${propertyValue}`,
35-
);
36-
return propertyValue;
28+
// Only use the repository property value if the FF is enabled.
29+
if (useRepositoryProperty) {
30+
logger.info(
31+
`Using configuration file input from repository property: ${propertyValue}`,
32+
);
33+
return propertyValue;
34+
} else {
35+
logger.info(
36+
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
37+
);
38+
}
3739
}
3840

3941
return undefined;

0 commit comments

Comments
 (0)