x-fidelity 3.13.0 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/core/configManager.test.js +2 -1
- package/dist/core/engine/engineRunner.test.js +1 -0
- package/dist/core/pluginRegistry.test.js +1 -0
- package/dist/demoConfig/node-fullstack-exemptions/project1-node-fullstack-exemptions.json +2 -2
- package/dist/facts/globalFileAnalysisFacts.test.js +1 -0
- package/dist/facts/index.test.js +3 -1
- package/dist/facts/openaiAnalysisFacts.test.js +1 -0
- package/dist/operators/fileContains.test.js +4 -1
- package/dist/operators/globalPatternCount.test.js +2 -0
- package/dist/operators/globalPatternRatio.test.js +2 -0
- package/dist/operators/openaiAnalysisHighSeverity.test.js +2 -0
- package/dist/operators/regexMatch.test.js +4 -1
- package/dist/plugins/xfiPluginRemoteStringValidator/facts/remoteSubstringValidation.test.js +2 -0
- package/dist/plugins/xfiPluginRemoteStringValidator/operators/invalidRemoteValidation.test.js +2 -0
- package/dist/plugins/xfiPluginRequiredFiles/operators/missingRequiredFiles.test.js +4 -1
- package/dist/server/cacheManager.test.js +2 -1
- package/dist/utils/exemptionUtils.js +15 -4
- package/dist/utils/exemptionUtils.test.js +1 -0
- package/dist/utils/ruleUtils.test.js +1 -0
- package/package.json +1 -1
- package/src/core/configManager.test.ts +2 -1
- package/src/core/engine/engineRunner.test.ts +1 -0
- package/src/core/pluginRegistry.test.ts +1 -0
- package/src/demoConfig/node-fullstack-exemptions/project1-node-fullstack-exemptions.json +2 -2
- package/src/exampleTriggerFiles/mixedUIComponents.tsx +9 -9
- package/src/facts/globalFileAnalysisFacts.test.ts +1 -0
- package/src/facts/index.test.ts +3 -1
- package/src/facts/openaiAnalysisFacts.test.ts +1 -0
- package/src/operators/fileContains.test.ts +4 -1
- package/src/operators/globalPatternCount.test.ts +2 -0
- package/src/operators/globalPatternRatio.test.ts +2 -0
- package/src/operators/openaiAnalysisHighSeverity.test.ts +2 -0
- package/src/operators/regexMatch.test.ts +4 -1
- package/src/plugins/xfiPluginRemoteStringValidator/facts/remoteSubstringValidation.test.ts +2 -0
- package/src/plugins/xfiPluginRemoteStringValidator/operators/invalidRemoteValidation.test.ts +2 -0
- package/src/plugins/xfiPluginRequiredFiles/operators/missingRequiredFiles.test.ts +4 -1
- package/src/server/cacheManager.test.ts +2 -1
- package/src/utils/exemptionUtils.test.ts +1 -0
- package/src/utils/exemptionUtils.ts +23 -5
- package/src/utils/ruleUtils.test.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.13.1](https://github.com/zotoio/x-fidelity/compare/v3.13.0...v3.13.1) (2025-03-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **exemptions:** trace logging ([343744c](https://github.com/zotoio/x-fidelity/commit/343744c161d2756d9fa5e419426d0b4f1a37d1d4))
|
|
7
|
+
|
|
1
8
|
# [3.13.0](https://github.com/zotoio/x-fidelity/compare/v3.12.1...v3.13.0) (2025-03-10)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"repoUrl": "git@github.com:zotoio/x-fidelity.git",
|
|
4
|
-
"rule": "
|
|
5
|
-
"expirationDate": "
|
|
4
|
+
"rule": "noDatabases-iterative",
|
|
5
|
+
"expirationDate": "2026-01-04",
|
|
6
6
|
"reason": "Upgrading dependencies is scheduled for Q4 2024"
|
|
7
7
|
},
|
|
8
8
|
{
|
package/dist/facts/index.test.js
CHANGED
|
@@ -5,7 +5,10 @@ const fileContains_1 = require("./fileContains");
|
|
|
5
5
|
jest.mock('../utils/logger', () => ({
|
|
6
6
|
logger: {
|
|
7
7
|
debug: jest.fn(),
|
|
8
|
-
error: jest.fn()
|
|
8
|
+
error: jest.fn(),
|
|
9
|
+
trace: jest.fn(),
|
|
10
|
+
info: jest.fn(),
|
|
11
|
+
warn: jest.fn()
|
|
9
12
|
},
|
|
10
13
|
}));
|
|
11
14
|
describe('fileContains', () => {
|
|
@@ -5,7 +5,10 @@ const logger_1 = require("../utils/logger");
|
|
|
5
5
|
jest.mock('../utils/logger', () => ({
|
|
6
6
|
logger: {
|
|
7
7
|
debug: jest.fn(),
|
|
8
|
-
error: jest.fn()
|
|
8
|
+
error: jest.fn(),
|
|
9
|
+
trace: jest.fn(),
|
|
10
|
+
info: jest.fn(),
|
|
11
|
+
warn: jest.fn()
|
|
9
12
|
},
|
|
10
13
|
}));
|
|
11
14
|
describe('regexMatch', () => {
|
|
@@ -5,7 +5,10 @@ const logger_1 = require("../../../utils/logger");
|
|
|
5
5
|
jest.mock('../../../utils/logger', () => ({
|
|
6
6
|
logger: {
|
|
7
7
|
debug: jest.fn(),
|
|
8
|
-
error: jest.fn()
|
|
8
|
+
error: jest.fn(),
|
|
9
|
+
trace: jest.fn(),
|
|
10
|
+
info: jest.fn(),
|
|
11
|
+
warn: jest.fn()
|
|
9
12
|
},
|
|
10
13
|
}));
|
|
11
14
|
describe('missingRequiredFiles', () => {
|
|
@@ -166,11 +166,22 @@ function isExempt(params) {
|
|
|
166
166
|
}
|
|
167
167
|
const now = new Date();
|
|
168
168
|
const normalizedRepoUrl = normalizeGitHubUrl(repoUrl);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
logger_1.logger.trace(`Checking exemption for rule ${ruleName} in repo ${repoUrl}`);
|
|
170
|
+
const exemption = exemptions.find(exemption => {
|
|
171
|
+
logger_1.logger.trace(JSON.stringify(exemption));
|
|
172
|
+
logger_1.logger.trace(`repoUrl: ${repoUrl}`);
|
|
173
|
+
logger_1.logger.trace(`ruleName: ${ruleName}`);
|
|
174
|
+
logger_1.logger.trace(`normalizedRepoUrl: ${normalizedRepoUrl}`);
|
|
175
|
+
logger_1.logger.trace(`now: ${now}`);
|
|
176
|
+
const result = normalizeGitHubUrl(exemption.repoUrl) === normalizedRepoUrl &&
|
|
177
|
+
exemption.rule === ruleName &&
|
|
178
|
+
new Date(exemption.expirationDate) > now;
|
|
179
|
+
logger_1.logger.trace(`Exemption check result: ${result}`);
|
|
180
|
+
return result;
|
|
181
|
+
});
|
|
182
|
+
logger_1.logger.trace(`Exemption: ${exemption}`);
|
|
172
183
|
if (exemption) {
|
|
173
|
-
logger_1.logger.error(`Exempting rule ${ruleName} for repo ${
|
|
184
|
+
logger_1.logger.error(`Exempting rule ${ruleName} for repo ${normalizedRepoUrl}: ${exemption.expirationDate}`);
|
|
174
185
|
// Send telemetry event for the allowed exemption
|
|
175
186
|
(0, telemetry_1.sendTelemetry)({
|
|
176
187
|
eventType: 'exemptionAllowed',
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"repoUrl": "git@github.com:zotoio/x-fidelity.git",
|
|
4
|
-
"rule": "
|
|
5
|
-
"expirationDate": "
|
|
4
|
+
"rule": "noDatabases-iterative",
|
|
5
|
+
"expirationDate": "2026-01-04",
|
|
6
6
|
"reason": "Upgrading dependencies is scheduled for Q4 2024"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Button } from 'antd';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import Checkbox from '@mui/material/Checkbox';
|
|
1
|
+
// import { Button } from 'antd';
|
|
2
|
+
// import * as React from 'react';
|
|
3
|
+
// import Checkbox from '@mui/material/Checkbox';
|
|
4
4
|
|
|
5
|
-
export default function ButtonUsage() {
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
// export default function ButtonUsage() {
|
|
6
|
+
// return <Button variant="contained">Hello world</Button>;
|
|
7
|
+
// }
|
|
8
8
|
|
|
9
|
-
export default function CheckboxUsage() {
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
// export default function CheckboxUsage() {
|
|
10
|
+
// return <Checkbox type="primary">Click Me</Checkbox>;
|
|
11
|
+
// }
|
package/src/facts/index.test.ts
CHANGED
|
@@ -155,13 +155,31 @@ export function isExempt(params: IsExemptParams): boolean {
|
|
|
155
155
|
}
|
|
156
156
|
const now = new Date();
|
|
157
157
|
const normalizedRepoUrl = normalizeGitHubUrl(repoUrl);
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
|
|
159
|
+
logger.trace(`Checking exemption for rule ${ruleName} in repo ${repoUrl}`);
|
|
160
|
+
|
|
161
|
+
const exemption = exemptions.find(exemption => {
|
|
162
|
+
|
|
163
|
+
logger.trace(JSON.stringify(exemption));
|
|
164
|
+
logger.trace(`repoUrl: ${repoUrl}`);
|
|
165
|
+
logger.trace(`ruleName: ${ruleName}`);
|
|
166
|
+
logger.trace(`normalizedRepoUrl: ${normalizedRepoUrl}`);
|
|
167
|
+
logger.trace(`now: ${now}`);
|
|
168
|
+
|
|
169
|
+
const result = normalizeGitHubUrl(exemption.repoUrl) === normalizedRepoUrl &&
|
|
160
170
|
exemption.rule === ruleName &&
|
|
161
|
-
new Date(exemption.expirationDate) > now
|
|
162
|
-
|
|
171
|
+
new Date(exemption.expirationDate) > now;
|
|
172
|
+
|
|
173
|
+
logger.trace(`Exemption check result: ${result}`);
|
|
174
|
+
|
|
175
|
+
return result;
|
|
176
|
+
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
logger.trace(`Exemption: ${exemption}`);
|
|
180
|
+
|
|
163
181
|
if (exemption) {
|
|
164
|
-
logger.error(`Exempting rule ${ruleName} for repo ${
|
|
182
|
+
logger.error(`Exempting rule ${ruleName} for repo ${normalizedRepoUrl}: ${exemption.expirationDate}`);
|
|
165
183
|
|
|
166
184
|
// Send telemetry event for the allowed exemption
|
|
167
185
|
sendTelemetry({
|