@elisra-devops/docgen-data-provider 1.106.0 → 1.107.0
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/.github/workflows/release.yml +28 -8
- package/README.md +7 -0
- package/bin/modules/TicketsDataProvider.d.ts +37 -0
- package/bin/modules/TicketsDataProvider.js +514 -2
- package/bin/modules/TicketsDataProvider.js.map +1 -1
- package/bin/tests/modules/ticketsDataProvider.historical.test.d.ts +1 -0
- package/bin/tests/modules/ticketsDataProvider.historical.test.js +478 -0
- package/bin/tests/modules/ticketsDataProvider.historical.test.js.map +1 -0
- package/bin/tests/modules/ticketsDataProvider.test.js +34 -1
- package/bin/tests/modules/ticketsDataProvider.test.js.map +1 -1
- package/package.json +1 -1
- package/src/modules/TicketsDataProvider.ts +657 -2
- package/src/tests/modules/ticketsDataProvider.historical.test.ts +543 -0
- package/src/tests/modules/ticketsDataProvider.test.ts +50 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: '🚀 publish'
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
@@ -7,10 +7,14 @@ on:
|
|
|
7
7
|
paths-ignore:
|
|
8
8
|
- '.github/**'
|
|
9
9
|
workflow_dispatch:
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
permissions:
|
|
12
12
|
contents: write
|
|
13
13
|
|
|
14
|
+
concurrency:
|
|
15
|
+
group: publish-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
14
18
|
jobs:
|
|
15
19
|
release:
|
|
16
20
|
name: 🚀 publish
|
|
@@ -20,8 +24,10 @@ jobs:
|
|
|
20
24
|
- name: 📚 checkout
|
|
21
25
|
uses: actions/checkout@v4
|
|
22
26
|
with:
|
|
23
|
-
token:
|
|
24
|
-
|
|
27
|
+
token: ${{ secrets.ELISRADEVOPS_ACCESS_TOKEN }}
|
|
28
|
+
ref: main
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
|
|
25
31
|
- name: 🟢 node
|
|
26
32
|
uses: actions/setup-node@v4
|
|
27
33
|
with:
|
|
@@ -35,12 +41,26 @@ jobs:
|
|
|
35
41
|
|
|
36
42
|
- run: npm run build
|
|
37
43
|
|
|
38
|
-
- name:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
- name: Check if current version exists on npm
|
|
45
|
+
id: check_npm_version
|
|
46
|
+
run: |
|
|
47
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
48
|
+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
49
|
+
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version >/dev/null 2>&1; then
|
|
50
|
+
echo "already_published=true" >> "$GITHUB_OUTPUT"
|
|
51
|
+
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} already exists on npm. Skipping publish and version bump."
|
|
52
|
+
else
|
|
53
|
+
echo "already_published=false" >> "$GITHUB_OUTPUT"
|
|
54
|
+
fi
|
|
42
55
|
|
|
43
56
|
- name: 🚀 publish
|
|
57
|
+
if: steps.check_npm_version.outputs.already_published != 'true'
|
|
44
58
|
run: npm publish --access public
|
|
45
59
|
env:
|
|
46
60
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
61
|
+
|
|
62
|
+
- name: 'Automated Version Bump'
|
|
63
|
+
if: steps.check_npm_version.outputs.already_published != 'true'
|
|
64
|
+
uses: 'phips28/gh-action-bump-version@master'
|
|
65
|
+
with:
|
|
66
|
+
commit-message: 'CI: bumps version to {{version}} [skip ci]'
|
package/README.md
CHANGED
|
@@ -63,3 +63,10 @@ The default export is `DgDataProviderAzureDevOps`, which creates module-specific
|
|
|
63
63
|
- This library uses `axios` and retries some transient failures (timeouts/429/5xx).
|
|
64
64
|
- `TicketsDataProvider.GetSharedQueries()` supports doc-type specific query layouts (e.g. `std`, `str`, `svd`, `srs`, `test-reporter`) and falls back to the provided root path when a dedicated folder is missing.
|
|
65
65
|
- In Node.js, the HTTP client is configured with `rejectUnauthorized: false` in `src/helpers/tfs.ts`, which may be required for some internal setups but is a security tradeoff.
|
|
66
|
+
|
|
67
|
+
## Release pipeline notes
|
|
68
|
+
|
|
69
|
+
- GitHub Actions publish workflow runs on `main` pushes (and manual dispatch).
|
|
70
|
+
- `npm publish` runs before version bump/tag.
|
|
71
|
+
- If current `package.json` version already exists on npm, publish and bump are skipped.
|
|
72
|
+
- On failed historical runs, prefer triggering a new run from latest `main` instead of rerunning an old workflow execution.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Links, Trace, Relations } from '../helpers/helper';
|
|
2
2
|
import { Query } from '../models/tfs-data';
|
|
3
|
+
type HistoricalQueryListItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
queryName: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
3
8
|
export default class TicketsDataProvider {
|
|
4
9
|
orgUrl: string;
|
|
5
10
|
token: string;
|
|
@@ -37,6 +42,7 @@ export default class TicketsDataProvider {
|
|
|
37
42
|
* @param docType document type
|
|
38
43
|
* @returns
|
|
39
44
|
*/
|
|
45
|
+
private normalizeSharedQueriesPath;
|
|
40
46
|
GetSharedQueries(project: string, path: string, docType?: string): Promise<any>;
|
|
41
47
|
/**
|
|
42
48
|
* Fetches the fields of a specific work item type.
|
|
@@ -162,6 +168,36 @@ export default class TicketsDataProvider {
|
|
|
162
168
|
GetQueryResultsByWiqlHref(wiqlHref: string, project: string): Promise<any>;
|
|
163
169
|
GetQueryResultsByWiqlString(wiql: string, projectName: string): Promise<any>;
|
|
164
170
|
GetQueryResultById(query: string, project: string): Promise<any>;
|
|
171
|
+
private normalizeHistoricalAsOf;
|
|
172
|
+
private normalizeHistoricalCompareValue;
|
|
173
|
+
private normalizeTestPhaseValue;
|
|
174
|
+
private isTestCaseType;
|
|
175
|
+
private toHistoricalRevision;
|
|
176
|
+
private extractHistoricalWorkItemIds;
|
|
177
|
+
private appendAsOfToWiql;
|
|
178
|
+
private appendApiVersion;
|
|
179
|
+
private shouldRetryHistoricalWithLowerVersion;
|
|
180
|
+
private withHistoricalApiVersionFallback;
|
|
181
|
+
private chunkHistoricalWorkItemIds;
|
|
182
|
+
private normalizeHistoricalQueryPath;
|
|
183
|
+
private normalizeHistoricalQueryRoot;
|
|
184
|
+
private fetchHistoricalWorkItemsBatch;
|
|
185
|
+
private executeHistoricalQueryAtAsOf;
|
|
186
|
+
private toHistoricalWorkItemSnapshot;
|
|
187
|
+
private getHistoricalSnapshot;
|
|
188
|
+
private collectHistoricalQueries;
|
|
189
|
+
/**
|
|
190
|
+
* Returns a flat list of shared queries for historical/as-of execution.
|
|
191
|
+
*/
|
|
192
|
+
GetHistoricalQueries(project: string, path?: string): Promise<HistoricalQueryListItem[]>;
|
|
193
|
+
/**
|
|
194
|
+
* Runs a shared query as-of a specific date-time and returns a flat work-item table snapshot.
|
|
195
|
+
*/
|
|
196
|
+
GetHistoricalQueryResults(queryId: string, project: string, asOfInput: string): Promise<any>;
|
|
197
|
+
/**
|
|
198
|
+
* Compares a shared query between two date-time baselines using the feature's noise-control fields.
|
|
199
|
+
*/
|
|
200
|
+
CompareHistoricalQueryResults(queryId: string, project: string, baselineAsOfInput: string, compareToAsOfInput: string): Promise<any>;
|
|
165
201
|
PopulateWorkItemsByIds(workItemsArray?: any[], projectName?: string): Promise<any[]>;
|
|
166
202
|
GetModeledQueryResults(results: any, project: string): Promise<Query>;
|
|
167
203
|
BuildColumns(results: any, queryResult: Query): void;
|
|
@@ -301,3 +337,4 @@ export default class TicketsDataProvider {
|
|
|
301
337
|
*/
|
|
302
338
|
GetCategorizedRequirementsByType(wiqlHref: string): Promise<any>;
|
|
303
339
|
}
|
|
340
|
+
export {};
|