@clickview/ship-it 0.0.41 → 0.0.42-rc.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.
Files changed (129) hide show
  1. package/Dockerfile +37 -33
  2. package/README.md +48 -48
  3. package/config.json +19 -19
  4. package/lib/config.json +20 -20
  5. package/lib/src/api-clients/git-lab/GitLabApiClient.js +581 -561
  6. package/lib/src/api-clients/git-lab/GitLabMapper.js +122 -122
  7. package/lib/src/api-clients/index.js +20 -20
  8. package/lib/src/api-clients/slack/SlackApiClient.js +206 -206
  9. package/lib/src/api-clients/team-city/TeamCityApiClient.js +100 -100
  10. package/lib/src/api-clients/trello/TrelloApiClient.js +145 -145
  11. package/lib/src/commands/BumpPackagesCommand.js +76 -76
  12. package/lib/src/commands/ConfigureProjectsCommand.js +84 -84
  13. package/lib/src/commands/CreateBranchCommand.js +100 -100
  14. package/lib/src/commands/CreateMergeRequestCommand.js +107 -107
  15. package/lib/src/commands/CreateNotesAuditCommand.js +84 -84
  16. package/lib/src/commands/CreateReleaseNotesCommand.js +95 -95
  17. package/lib/src/commands/CreateTrelloCardsCommand.js +76 -77
  18. package/lib/src/commands/InstallPackagesCommand.js +76 -76
  19. package/lib/src/commands/ListProjectsCommand.js +76 -76
  20. package/lib/src/commands/ReleaseCommand.js +136 -136
  21. package/lib/src/commands/StartProjectBuildsCommand.js +76 -76
  22. package/lib/src/commands/StatusCommand.js +93 -93
  23. package/lib/src/commands/TagMasterCommand.js +76 -76
  24. package/lib/src/commands/ToolingReleaseCommand.js +144 -0
  25. package/lib/src/commands/ValidateMergeRequestCommand.js +76 -76
  26. package/lib/src/commands/VersionCommand.js +76 -76
  27. package/lib/src/commands/index.js +32 -31
  28. package/lib/src/constants/CommandTypeMapping.js +22 -21
  29. package/lib/src/constants/GitLabMemberIds.js +6 -6
  30. package/lib/src/constants/MonorepoPackageJsonFiles.js +41 -41
  31. package/lib/src/constants/MonorepoProjectNames.js +16 -16
  32. package/lib/src/constants/ProjectNames.js +69 -69
  33. package/lib/src/constants/SlackUserEmailList.js +13 -13
  34. package/lib/src/constants/TeamCityBuildIDs.js +46 -46
  35. package/lib/src/constants/index.js +19 -19
  36. package/lib/src/errors/ShipItError.js +32 -32
  37. package/lib/src/errors/index.js +17 -17
  38. package/lib/src/index.js +18 -18
  39. package/lib/src/interfaces/Config.js +2 -2
  40. package/lib/src/interfaces/MergeRequestState.js +2 -2
  41. package/lib/src/interfaces/ProjectNames.js +2 -2
  42. package/lib/src/interfaces/ShipItCommand.js +2 -2
  43. package/lib/src/interfaces/ShipItTask.js +2 -2
  44. package/lib/src/interfaces/SourceBranch.js +2 -0
  45. package/lib/src/interfaces/VersionType.js +2 -2
  46. package/lib/src/interfaces/command-cli-options/DockerMilestoneCommandCliOptions.js +2 -0
  47. package/lib/src/interfaces/command-cli-options/MilestoneCommandCliOptions.js +2 -2
  48. package/lib/src/interfaces/command-cli-options/ReleaseCommandCliOptions.js +2 -2
  49. package/lib/src/interfaces/command-cli-options/StatusCommandCliOptions.js +2 -2
  50. package/lib/src/interfaces/command-cli-options/ToolingReleaseCommandCliOptions.js +2 -0
  51. package/lib/src/interfaces/command-cli-options/index.js +20 -19
  52. package/lib/src/interfaces/command-options/BaseCommandOptions.js +2 -2
  53. package/lib/src/interfaces/command-options/BumpPackagesCommandOptions.js +2 -2
  54. package/lib/src/interfaces/command-options/ConfigureProjectsOptions.js +2 -2
  55. package/lib/src/interfaces/command-options/DockerMilestoneCommandOptions.js +2 -2
  56. package/lib/src/interfaces/command-options/MilestoneCommandOptions.js +2 -2
  57. package/lib/src/interfaces/command-options/ReleaseCommandOptions.js +2 -2
  58. package/lib/src/interfaces/command-options/StatusCommandOptions.js +2 -2
  59. package/lib/src/interfaces/command-options/ToolingReleaseCommandOptions.js +2 -0
  60. package/lib/src/interfaces/command-options/ValidateMRCommandOptions.js +2 -2
  61. package/lib/src/interfaces/command-options/index.js +24 -23
  62. package/lib/src/interfaces/index.js +26 -26
  63. package/lib/src/interfaces/models/ApprovalRule.js +2 -2
  64. package/lib/src/interfaces/models/ApprovalRuleConfiguration.js +2 -2
  65. package/lib/src/interfaces/models/Branch.js +2 -2
  66. package/lib/src/interfaces/models/Commit.js +2 -2
  67. package/lib/src/interfaces/models/CommitFile.js +2 -2
  68. package/lib/src/interfaces/models/CreateApprovalRuleRequest.js +2 -2
  69. package/lib/src/interfaces/models/File.js +2 -2
  70. package/lib/src/interfaces/models/Group.js +2 -2
  71. package/lib/src/interfaces/models/Label.js +2 -2
  72. package/lib/src/interfaces/models/MergeRequest.js +2 -2
  73. package/lib/src/interfaces/models/Milestone.js +2 -2
  74. package/lib/src/interfaces/models/Project.js +2 -2
  75. package/lib/src/interfaces/models/ProjectConfig.js +9 -9
  76. package/lib/src/interfaces/models/ProtectedBranch.js +2 -2
  77. package/lib/src/interfaces/models/Release.js +2 -2
  78. package/lib/src/interfaces/models/Tag.js +2 -2
  79. package/lib/src/interfaces/models/index.js +32 -32
  80. package/lib/src/interfaces/view-models/MilestoneProject.js +2 -2
  81. package/lib/src/interfaces/view-models/index.js +17 -17
  82. package/lib/src/inversify.config.js +82 -79
  83. package/lib/src/services/GitLabService.js +556 -544
  84. package/lib/src/services/SlackService.js +142 -142
  85. package/lib/src/services/TeamCityService.js +37 -37
  86. package/lib/src/services/TrelloService.js +84 -84
  87. package/lib/src/services/index.js +20 -20
  88. package/lib/src/startup/AddMilestoneCommand.js +92 -96
  89. package/lib/src/startup/GetAction.js +68 -68
  90. package/lib/src/startup/SetupCommands.js +228 -180
  91. package/lib/src/tasks/BumpPackagesTask.js +230 -230
  92. package/lib/src/tasks/BumpVersionTxtTask.js +110 -110
  93. package/lib/src/tasks/{CommitPackageVersionsTask.js → ChangeMilestoneTask.js} +117 -116
  94. package/lib/src/tasks/CreateBranchTask.js +109 -104
  95. package/lib/src/tasks/CreateMergeRequestTask.js +126 -118
  96. package/lib/src/tasks/CreateNotesAuditTask.js +140 -140
  97. package/lib/src/tasks/CreateReleaseNotesTask.js +144 -144
  98. package/lib/src/tasks/InstallPackagesTask.js +409 -415
  99. package/lib/src/tasks/ListProjectsTask.js +87 -87
  100. package/lib/src/tasks/PopulateTrelloBoardTask.js +140 -140
  101. package/lib/src/tasks/StartMonorepoBuildTask.js +109 -109
  102. package/lib/src/tasks/StartProjectBuildsTask.js +164 -170
  103. package/lib/src/tasks/TagMasterTask.js +200 -189
  104. package/lib/src/tasks/ValidateCommitsTask.js +210 -143
  105. package/lib/src/tasks/ValidateDescriptionsTask.js +164 -178
  106. package/lib/src/tasks/ValidateMergeRequestTask.js +115 -115
  107. package/lib/src/tasks/ValidateTask.js +419 -419
  108. package/lib/src/tasks/VersionTask.js +98 -98
  109. package/lib/src/tasks/configure-projects/AddApprovalRulesTask.js +199 -199
  110. package/lib/src/tasks/configure-projects/CreateToolingBranchTask.js +138 -138
  111. package/lib/src/tasks/configure-projects/EnsureApprovalRulesTask.js +106 -106
  112. package/lib/src/tasks/configure-projects/index.js +18 -18
  113. package/lib/src/tasks/configure-projects/primitives/BaseConfigureProjectsTask.js +98 -98
  114. package/lib/src/tasks/index.js +34 -34
  115. package/lib/src/types.js +62 -60
  116. package/lib/src/utils/BranchNames.js +11 -11
  117. package/lib/src/utils/Commits.js +90 -55
  118. package/lib/src/utils/Csv.js +54 -54
  119. package/lib/src/utils/Descriptions.js +274 -274
  120. package/lib/src/utils/GroupIds.js +6 -6
  121. package/lib/src/utils/Logger.js +62 -62
  122. package/lib/src/utils/ProjectIds.js +48 -47
  123. package/lib/src/utils/Versions.js +20 -20
  124. package/lib/src/utils/index.js +22 -22
  125. package/package.json +50 -50
  126. package/dist/I3/I3 Notes Audit.csv +0 -127
  127. package/dist/J1/J1 Notes Audit.csv +0 -38
  128. package/dist/J2/J2 Notes Audit.csv +0 -52
  129. package/dist/L1/L1 Notes Audit.csv +0 -139
package/Dockerfile CHANGED
@@ -1,33 +1,37 @@
1
- FROM node:18.11.0
2
-
3
- WORKDIR /app
4
-
5
- COPY ["src", "src/"]
6
- # Copy files needed to install NPM packages
7
- COPY ["package.json", "package-lock.json", "./"]
8
-
9
- COPY ["tsconfig.json", "config.json", ".eslintrc.json", "./"]
10
-
11
- # Set an authentication token for NPM, allowing the build machine to install private NPM packages
12
- ARG npm_token
13
- ARG milestone
14
- ARG command
15
- ARG options
16
- ENV cliOptions=""
17
-
18
- RUN npm config set '//registry.npmjs.org/:_authToken' $npm_token
19
- RUN npm config set save-exact=true
20
- # Note: As of writing, NPM versions beyond 8.5.5 cannot run `npm ci` without failing. Once this is fixed, the line below should be deleted
21
- RUN npm install -g npm@8.5.5
22
-
23
- # Install NPM packages
24
- RUN npm install
25
-
26
- RUN npm run build
27
-
28
- RUN npm link
29
-
30
- RUN cliOptions=$(echo "$options" | sed -e 's/^"//' -e 's/"$//') && \
31
- echo "Build option: $cliOptions" && \
32
- ship-it $command -m $milestone $cliOptions
33
-
1
+ FROM node:18.11.0
2
+
3
+ WORKDIR /app
4
+
5
+ COPY ["src", "src/"]
6
+ # Copy files needed to install NPM packages
7
+ COPY ["package.json", "package-lock.json", "./"]
8
+
9
+ COPY ["tsconfig.json", "config.json", ".eslintrc.json", "./"]
10
+
11
+ # Set an authentication token for NPM, allowing the build machine to install private NPM packages
12
+ ARG npm_token
13
+ ARG milestone
14
+ ARG sprint
15
+ ARG command
16
+ ARG options
17
+ ENV cliOptions=""
18
+
19
+ RUN npm config set '//registry.npmjs.org/:_authToken' $npm_token
20
+ RUN npm config set save-exact=true
21
+ # Note: As of writing, NPM versions beyond 8.5.5 cannot run `npm ci` without failing. Once this is fixed, the line below should be deleted
22
+ RUN npm install -g npm@8.5.5
23
+
24
+ # Install NPM packages
25
+ RUN npm install
26
+
27
+ RUN npm run build
28
+
29
+ RUN npm link
30
+
31
+ RUN cliOptions=$(echo "$options" | sed -e 's/^"//' -e 's/"$//') && \
32
+ echo "Build option: $cliOptions" && \
33
+ if [ "$milestone" = "sprint" ]; then \
34
+ ship-it $command -s $sprint $cliOptions; \
35
+ else \
36
+ ship-it $command -m $milestone $cliOptions; \
37
+ fi
package/README.md CHANGED
@@ -1,48 +1,48 @@
1
- # Ship It
2
-
3
- ## Introduction
4
-
5
- "Ship It" is a CLI tool that was created to automate aspects of our release workflow.
6
-
7
- ### How To Manage A Release
8
-
9
- If you are here to learn how to manage a release, please see [this document](https://clickview.quip.com/DbEyAaVK8sqB/Release-Manager-Checklist) instead.
10
-
11
- ### How To Contribute
12
-
13
- If you are here instead of learn about or contribute to this project, then you're in the right place! Keep reading :)
14
-
15
- ## Prerequisites
16
-
17
- * NodeJS (and npm)
18
- * Access to the ClickView organization on [npm](https://www.npmjs.com). You will need to add an npm auth token to a global or local `.npmrc` file
19
- * Add the `Ship It` user as a `Developer` to each GitLab project you would like to manage using the Ship It CLI
20
-
21
- ## Getting Started
22
-
23
- ```
24
- git clone https://gitlab.cvinternal.net/front-end/ship-it.git
25
- cd ship-it
26
- npm install
27
- ```
28
-
29
- After installation, you can run `npm run start -- help` to see the full list of commands.
30
-
31
- ## Contributing
32
-
33
- ### Open Issues
34
-
35
- All bugs / feature requests are tracked in the [issues](https://gitlab.cvinternal.net/clickview/front-end/ship-it/-/issues) section of this project.
36
-
37
- Anyone is free to pick up an issue and work on it at will! Don't be afraid, the TypeScript won't bite.
38
-
39
- ### Project Architecture
40
-
41
- Each CLI command is defined in the `startup/SetupCommands.ts` file.
42
-
43
- Each command maps to a particular TypeScript class in the `commands` directory.
44
- These command classes typically just sequentially run a set of "tasks", where each "task" can be shared across different commands.
45
- Each task also exists as a TypeScript class under the `tasks` directory.
46
-
47
- All code written in this project is intended to be highly reusable! If you are contributing a new command or updating an existing one, be sure to see if the code you're looking for already exists.
48
-
1
+ # Ship It
2
+
3
+ ## Introduction
4
+
5
+ "Ship It" is a CLI tool that was created to automate aspects of our release workflow.
6
+
7
+ ### How To Manage A Release
8
+
9
+ If you are here to learn how to manage a release, please see [this document](https://clickview.quip.com/DbEyAaVK8sqB/Release-Manager-Checklist) instead.
10
+
11
+ ### How To Contribute
12
+
13
+ If you are here instead of learn about or contribute to this project, then you're in the right place! Keep reading :)
14
+
15
+ ## Prerequisites
16
+
17
+ * NodeJS (and npm)
18
+ * Access to the ClickView organization on [npm](https://www.npmjs.com). You will need to add an npm auth token to a global or local `.npmrc` file
19
+ * Add the `Ship It` user as a `Developer` to each GitLab project you would like to manage using the Ship It CLI
20
+
21
+ ## Getting Started
22
+
23
+ ```
24
+ git clone https://gitlab.cvinternal.net/front-end/ship-it.git
25
+ cd ship-it
26
+ npm install
27
+ ```
28
+
29
+ After installation, you can run `npm run start -- help` to see the full list of commands.
30
+
31
+ ## Contributing
32
+
33
+ ### Open Issues
34
+
35
+ All bugs / feature requests are tracked in the [issues](https://gitlab.cvinternal.net/clickview/front-end/ship-it/-/issues) section of this project.
36
+
37
+ Anyone is free to pick up an issue and work on it at will! Don't be afraid, the TypeScript won't bite.
38
+
39
+ ### Project Architecture
40
+
41
+ Each CLI command is defined in the `startup/SetupCommands.ts` file.
42
+
43
+ Each command maps to a particular TypeScript class in the `commands` directory.
44
+ These command classes typically just sequentially run a set of "tasks", where each "task" can be shared across different commands.
45
+ Each task also exists as a TypeScript class under the `tasks` directory.
46
+
47
+ All code written in this project is intended to be highly reusable! If you are contributing a new command or updating an existing one, be sure to see if the code you're looking for already exists.
48
+
package/config.json CHANGED
@@ -1,20 +1,20 @@
1
- {
2
- "gitLab": {
3
- "accessToken": "glpat-d9TACyfNj3uaetfbGiPp",
4
- "url": "https://gitlab.cvinternal.net"
5
- },
6
- "teamCity": {
7
- "url": "http://build.cvinternal.net/",
8
- "username": "shale.kuzmanovski",
9
- "password": "hock-inflame-prodigy-unstrap"
10
- },
11
- "slack": {
12
- "botToken": "xoxb-10474490612-6484075093633-vEo2cgvi7nma9DDSzPEXWDrw",
13
- "channelId": "C03DX0DSG3F"
14
- },
15
- "trello": {
16
- "apiKey": "6e887685d44e94ae9a680c010c4b622d",
17
- "apiToken": "ATTA558c8969ce04b46fb9c9d6f645aa51be7f1c9dbb9b6f5f6f85ae6da2a209c1f39AAC612F",
18
- "boardId": "3edi3xiO"
19
- }
1
+ {
2
+ "gitLab": {
3
+ "accessToken": "glpat-d9TACyfNj3uaetfbGiPp",
4
+ "url": "https://gitlab.cvinternal.net"
5
+ },
6
+ "teamCity": {
7
+ "url": "http://build.cvinternal.net/",
8
+ "username": "shale.kuzmanovski",
9
+ "password": "hock-inflame-prodigy-unstrap"
10
+ },
11
+ "slack": {
12
+ "botToken": "xoxb-10474490612-6484075093633-vEo2cgvi7nma9DDSzPEXWDrw",
13
+ "channelId": "C03DX0DSG3F"
14
+ },
15
+ "trello": {
16
+ "apiKey": "6e887685d44e94ae9a680c010c4b622d",
17
+ "apiToken": "ATTA558c8969ce04b46fb9c9d6f645aa51be7f1c9dbb9b6f5f6f85ae6da2a209c1f39AAC612F",
18
+ "boardId": "3edi3xiO"
19
+ }
20
20
  }
package/lib/config.json CHANGED
@@ -1,20 +1,20 @@
1
- {
2
- "gitLab": {
3
- "accessToken": "glpat-d9TACyfNj3uaetfbGiPp",
4
- "url": "https://gitlab.cvinternal.net"
5
- },
6
- "teamCity": {
7
- "url": "http://build.cvinternal.net/",
8
- "username": "shale.kuzmanovski",
9
- "password": "hock-inflame-prodigy-unstrap"
10
- },
11
- "slack": {
12
- "botToken": "xoxb-10474490612-6484075093633-vEo2cgvi7nma9DDSzPEXWDrw",
13
- "channelId": "C03DX0DSG3F"
14
- },
15
- "trello": {
16
- "apiKey": "6e887685d44e94ae9a680c010c4b622d",
17
- "apiToken": "ATTA558c8969ce04b46fb9c9d6f645aa51be7f1c9dbb9b6f5f6f85ae6da2a209c1f39AAC612F",
18
- "boardId": "3edi3xiO"
19
- }
20
- }
1
+ {
2
+ "gitLab": {
3
+ "accessToken": "glpat-d9TACyfNj3uaetfbGiPp",
4
+ "url": "https://gitlab.cvinternal.net"
5
+ },
6
+ "teamCity": {
7
+ "url": "http://build.cvinternal.net/",
8
+ "username": "shale.kuzmanovski",
9
+ "password": "hock-inflame-prodigy-unstrap"
10
+ },
11
+ "slack": {
12
+ "botToken": "xoxb-10474490612-6484075093633-vEo2cgvi7nma9DDSzPEXWDrw",
13
+ "channelId": "C03DX0DSG3F"
14
+ },
15
+ "trello": {
16
+ "apiKey": "6e887685d44e94ae9a680c010c4b622d",
17
+ "apiToken": "ATTA558c8969ce04b46fb9c9d6f645aa51be7f1c9dbb9b6f5f6f85ae6da2a209c1f39AAC612F",
18
+ "boardId": "3edi3xiO"
19
+ }
20
+ }