@docupace/pipeline 1.0.108 → 1.0.110

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.
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json",
3
+ "changelog": "@changesets/cli/changelog",
4
+ "commit": false,
5
+ "fixed": [],
6
+ "linked": [],
7
+ "access": "restricted",
8
+ "baseBranch": "master",
9
+ "updateInternalDependencies": "patch",
10
+ "ignore": []
11
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
1
+ # @docupace/pipeline
2
+
3
+ ## 1.0.110
4
+
5
+ ### Patch Changes
6
+
7
+ - 672f1c0: Fix Pipeline
8
+
9
+ ## 1.0.110
10
+
11
+ ### Patch Changes
12
+
13
+ - e4eac44: Fix publish
14
+
15
+ ## 1.0.110
16
+
17
+ ### Patch Changes
18
+
19
+ - 067293a: Fix pipleine
20
+
21
+ ## 1.0.110
22
+
23
+ ### Patch Changes
24
+
25
+ - e9e26c0: Fix Publish
26
+
27
+ ## 1.0.110
28
+
29
+ ### Patch Changes
30
+
31
+ - Fix for publishing
32
+
33
+ ## 1.0.110
34
+
35
+ ### Patch Changes
36
+
37
+ - 412e6ec: Fix for publishing
38
+ - Updated dependencies [412e6ec]
39
+ - @docupace/pipeline@1.0.110
40
+
41
+ ## 1.0.110
42
+
43
+ ### Patch Changes
44
+
45
+ - 456ee5f: Add support for publishing
46
+ - Updated dependencies [456ee5f]
47
+ - @docupace/pipeline@1.0.110
@@ -2,6 +2,22 @@
2
2
  clone:
3
3
  depth: 2
4
4
 
5
+ definitions:
6
+ caches:
7
+ pnpm: ~/.pnpm-store
8
+ steps:
9
+ - step: &version-step
10
+ runs-on:
11
+ - self.hosted
12
+ - linux.shell
13
+ - onprem
14
+ name: On Merge
15
+ script:
16
+ - npm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
17
+ - pnpm install --frozen-lockfile
18
+ - export HOME=/tmp
19
+ - node src/changeset/cli.js version-commit-tag
20
+
5
21
  pipelines:
6
22
  pull-requests:
7
23
  '**':
@@ -9,29 +25,13 @@ pipelines:
9
25
  runs-on:
10
26
  - self.hosted
11
27
  - linux.shell
28
+ - onprem
12
29
  name: On Pull Request
13
30
  script:
14
- - npm install -g pnpm
15
- - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
16
- - pnpm install --frozen-lockfile
17
- - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
18
- - pnpm test
19
- artifacts:
20
- - coverage/**
21
- after-script:
22
- - echo "Pipeline completed with status $BITBUCKET_EXIT_CODE"
23
-
24
- custom:
25
- scheduled-tests:
26
- - step:
27
- runs-on:
28
- - self.hosted
29
- - linux.shell
30
- name: Scheduled Tests
31
- script:
32
- - npm install -g pnpm
33
31
  - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
34
32
  - pnpm install --frozen-lockfile
33
+ - export HOME=/tmp
34
+ - node src/changeset/cli.js validate
35
35
  - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
36
36
  - pnpm test
37
37
  artifacts:
@@ -40,21 +40,22 @@ pipelines:
40
40
  - echo "Pipeline completed with status $BITBUCKET_EXIT_CODE"
41
41
 
42
42
  branches:
43
- main:
43
+ master:
44
+ - step: *version-step
45
+ 'release/*':
46
+ - step: *version-step
47
+
48
+ tags:
49
+ 'v*':
44
50
  - step:
45
51
  runs-on:
46
52
  - self.hosted
47
53
  - linux.shell
48
- name: Main Branch Build
54
+ - onprem
55
+ name: On Tag
49
56
  script:
50
- - npm install -g pnpm
51
57
  - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
52
58
  - pnpm install --frozen-lockfile
53
59
  - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
54
60
  - pnpm test
55
- artifacts:
56
- - coverage/**
57
-
58
- definitions:
59
- caches:
60
- pnpm: ~/.pnpm-store
61
+ - pnpm publish --no-git-checks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.108",
3
+ "version": "1.0.110",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,7 +21,6 @@
21
21
  "license": "ISC",
22
22
  "dependencies": {
23
23
  "@changesets/cli": "^2.27.10",
24
- "@docupace/pipeline": "^1.0.86",
25
24
  "@jest/globals": "^30.1.2",
26
25
  "@docupace/core-client": "^0.1.59",
27
26
  "auth0-deploy-cli": "^8.8.0",
@@ -3,6 +3,7 @@ export const componentConfig = {
3
3
  '@docupace/cc-ui-app': 'C & C Application',
4
4
  '@docupace/core': 'Enterprise Core',
5
5
  '@docupace/graphql-server': 'Enterprise',
6
+ 'docupace-graphql-server': 'Enterprise',
6
7
  '@docupace/enterprise-template': 'Enterprise',
7
8
  '@docupace/compliance-edge-ui-app': 'Compliance Edge',
8
9
  };
@@ -72,6 +72,7 @@ export async function versionCommand(closeVersion = false) {
72
72
  await $`mv package.json package.json.bak`;
73
73
  await $`mv pnpm-lock.yaml pnpm-lock.yaml.bak`;
74
74
  await fs.promises.writeFile('package.json', changeSetPackage);
75
+ await $`npm config set //registry.npmjs.org/:_authToken ${process.env.DOCUPACE_NPM_TOKEN}`;
75
76
  await $`pnpm install`;
76
77
  await $`rm package.json pnpm-lock.yaml`;
77
78
  await $`mv package.json.bak package.json`;
@@ -1006,6 +1006,7 @@ export async function deployFromSite(
1006
1006
  }
1007
1007
  }
1008
1008
 
1009
+ let autoDeployUpdated = false;
1009
1010
  if (!oldVersion || !newVersion) {
1010
1011
  console.log(
1011
1012
  `Info: Could not determine versions for auto-deploy check (old: ${oldVersion}, new: ${newVersion})`,
@@ -1015,7 +1016,7 @@ export async function deployFromSite(
1015
1016
  `Info: Version unchanged (${newVersion}), skipping auto-deploy update`,
1016
1017
  );
1017
1018
  } else {
1018
- const autoDeployUpdated = await updateAutoDeployVersion(
1019
+ autoDeployUpdated = await updateAutoDeployVersion(
1019
1020
  fromEnv,
1020
1021
  toEnv,
1021
1022
  toSite,
@@ -1037,6 +1038,14 @@ export async function deployFromSite(
1037
1038
  toRepoPath,
1038
1039
  `Updated deployment configurations from ${fromEnv}/${fromSite} to ${toEnv}/${toSite}`,
1039
1040
  );
1041
+ // auto-deploy.yaml lives in gitops-dev; push it separately when toEnv isn't dev
1042
+ if (autoDeployUpdated && toEnv !== 'dev') {
1043
+ const { repoPath: devRepoPath } = getRepoLocalPath('dev');
1044
+ await pushDeployConfig(
1045
+ devRepoPath,
1046
+ `Update auto-deploy version for ${toEnv}/${toSite}`,
1047
+ );
1048
+ }
1040
1049
  console.log('All configurations updated and pushed successfully.');
1041
1050
  } else {
1042
1051
  console.log('No changes detected. Nothing to push.');
@@ -712,6 +712,59 @@ describe('deployFromSite', () => {
712
712
  });
713
713
  });
714
714
 
715
+ it('should push gitops-dev when auto-deploy is updated for non-dev toEnv', async () => {
716
+ // fromEnv=dev, toEnv=qa — auto-deploy.yaml lives in gitops-dev (the from repo)
717
+ // Deploying v1.17.x → v1.18.x causes a major/minor bump, so auto-deploy.yaml is updated
718
+ const mockFromConfig = { image: { tag: 'v1.18.0' } };
719
+ const mockToConfig = { image: { tag: 'v1.17.5' } };
720
+ const mockToAppConfig = { revision: 'v1.17.5' };
721
+ const mockAutoDeployConfig = [
722
+ { env: 'qa', site: 'usafinancial', version: '1.17' },
723
+ ];
724
+
725
+ yaml.load
726
+ .mockReturnValueOnce(mockFromConfig) // version capture: fromConfig
727
+ .mockReturnValueOnce(mockToConfig) // version capture: toConfig
728
+ .mockReturnValueOnce(mockFromConfig) // deployApp: fromDeployConfig
729
+ .mockReturnValueOnce(mockToConfig) // deployApp: toDeployConfig
730
+ .mockReturnValueOnce(mockToAppConfig) // deployApp: toDeployAppConfig
731
+ .mockReturnValueOnce(mockAutoDeployConfig) // updateAutoDeployVersion: auto-deploy.yaml
732
+ .mockReturnValueOnce(mockFromConfig) // validateDeployVersionConsistency: values
733
+ .mockReturnValueOnce(mockToAppConfig); // validateDeployVersionConsistency: app
734
+
735
+ yaml.dump.mockReturnValue('updated');
736
+
737
+ // auto-deploy.yaml exists in gitops-dev
738
+ fs.existsSync.mockImplementation((p) => {
739
+ if (p.includes('auto-deploy.yaml')) return true;
740
+ return true;
741
+ });
742
+
743
+ const gitStatusCalls = [];
744
+ $.mockImplementation((strings) => {
745
+ const cmdStr = Array.isArray(strings)
746
+ ? strings.join('')
747
+ : String(strings);
748
+ if (cmdStr.includes('git status --porcelain')) {
749
+ gitStatusCalls.push(cmdStr);
750
+ return Promise.resolve({ stdout: ' M file.yaml\n', stderr: '' });
751
+ }
752
+ return Promise.resolve({ stdout: '', stderr: '' });
753
+ });
754
+
755
+ await deployFromSite(
756
+ 'dev',
757
+ 'financialdev',
758
+ 'qa',
759
+ 'usafinancial',
760
+ 'false',
761
+ 'false',
762
+ );
763
+
764
+ // Two pushes should have occurred: one for gitops-qa, one for gitops-dev
765
+ expect(gitStatusCalls.length).toBeGreaterThanOrEqual(2);
766
+ });
767
+
715
768
  it('should require JIRA ticket for prod deployments', async () => {
716
769
  // Setup mocks for yaml.load (need 3 calls for fromConfig, toConfig, toAppConfig)
717
770
  const mockFromConfig = { image: { tag: 'v1.0.0' } };