fiftyone.geolocation 4.4.1 → 4.4.3

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 (118) hide show
  1. package/.github/workflows/monthly-copyright-update.yml +21 -0
  2. package/.github/workflows/nightly-documentation-update.yml +21 -0
  3. package/.github/workflows/nightly-package-update.yml +22 -0
  4. package/.github/workflows/nightly-prs-to-main.yml +22 -0
  5. package/.github/workflows/nightly-publish-to-main.yml +23 -0
  6. package/ci/README.md +11 -1
  7. package/ci/build-package-requirements.ps1 +1 -0
  8. package/ci/build-package.ps1 +14 -0
  9. package/ci/build-project.ps1 +16 -0
  10. package/ci/fetch-assets.ps1 +1 -0
  11. package/ci/get-next-package-version.ps1 +10 -0
  12. package/ci/install-package.ps1 +8 -0
  13. package/ci/options.json +50 -0
  14. package/ci/package-update-required.ps1 +1 -0
  15. package/ci/publish-package.ps1 +10 -0
  16. package/ci/run-integration-tests.ps1 +22 -0
  17. package/ci/run-performance-tests.ps1 +8 -0
  18. package/ci/run-unit-tests.ps1 +8 -0
  19. package/ci/setup-environment.ps1 +13 -0
  20. package/ci/update-packages.ps1 +10 -0
  21. package/docs/Doxyfile +12 -10
  22. package/package.json +11 -11
  23. package/tests/geoLocationCloud.test.js +0 -28
  24. package/ci/build-and-test.yml +0 -34
  25. package/ci/common-ci/.github/labels.yml +0 -86
  26. package/ci/common-ci/.github/workflows/sync-labels.yml +0 -52
  27. package/ci/common-ci/CiTips.md +0 -34
  28. package/ci/common-ci/GitVersion.yml +0 -18
  29. package/ci/common-ci/LICENSE +0 -286
  30. package/ci/common-ci/README.md +0 -365
  31. package/ci/common-ci/build-and-test.yml +0 -65
  32. package/ci/common-ci/c/shared-variables.yml +0 -15
  33. package/ci/common-ci/check-merge-commit-format.yml +0 -56
  34. package/ci/common-ci/cloud-release-config.json +0 -51
  35. package/ci/common-ci/create-tag.yml +0 -44
  36. package/ci/common-ci/deploy.yml +0 -25
  37. package/ci/common-ci/dotnet/shared-code-signing-steps.yml +0 -20
  38. package/ci/common-ci/dotnet/shared-extract-and-publish-packages.yml +0 -29
  39. package/ci/common-ci/go/shared-go-list-stage.yml +0 -64
  40. package/ci/common-ci/java/readme.md +0 -22
  41. package/ci/common-ci/java/shared-package-signing-steps.yml +0 -17
  42. package/ci/common-ci/java/shared-security-vulnerability-check.yml +0 -54
  43. package/ci/common-ci/node/shared-extract-and-publish-packages.yml +0 -26
  44. package/ci/common-ci/php/readme.md +0 -15
  45. package/ci/common-ci/release-config-schema.json +0 -52
  46. package/ci/common-ci/release-config-template.json +0 -310
  47. package/ci/common-ci/release-config.json +0 -151
  48. package/ci/common-ci/release-process.drawio +0 -165
  49. package/ci/common-ci/release-process.png +0 -0
  50. package/ci/common-ci/scripts/azure/checkSlot.ps1 +0 -28
  51. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.Tests.ps1 +0 -1
  52. package/ci/common-ci/scripts/modules/51DAuthorizationModule/51DAuthorizationModule.psm1 +0 -16
  53. package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.Tests.ps1 +0 -3
  54. package/ci/common-ci/scripts/modules/51DBuildModule/51DBuildModule.psm1 +0 -200
  55. package/ci/common-ci/scripts/modules/51DDeployModule/51DDeployModule.psm1 +0 -66
  56. package/ci/common-ci/scripts/modules/51DDownloadDataFileModule/51DDownloadDataFileModule.psm1 +0 -74
  57. package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.Tests.ps1 +0 -25
  58. package/ci/common-ci/scripts/modules/51DEnvironmentModule/51DEnvironmentModule.psm1 +0 -22
  59. package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.Tests.ps1 +0 -1
  60. package/ci/common-ci/scripts/modules/51DErrorHandleModule/51DErrorHandleModule.psm1 +0 -41
  61. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.Tests.ps1 +0 -5
  62. package/ci/common-ci/scripts/modules/51DGitModule/51DGitModule.psm1 +0 -765
  63. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.Tests.ps1 +0 -842
  64. package/ci/common-ci/scripts/modules/51DPackageModule/51DPackageModule.psm1 +0 -926
  65. package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.Tests.ps1 +0 -1
  66. package/ci/common-ci/scripts/modules/51DPipelineModule/51DPipelineModule.psm1 +0 -87
  67. package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.Tests.ps1 +0 -194
  68. package/ci/common-ci/scripts/modules/51DPullRequestModule/51DPullRequestModule.psm1 +0 -653
  69. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.Tests.ps1 +0 -277
  70. package/ci/common-ci/scripts/modules/51DReleaseModule/51DReleaseModule.psm1 +0 -554
  71. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.Tests.ps1 +0 -1141
  72. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psd1 +0 -0
  73. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/51DReleaseTestEnvModule.psm1 +0 -1465
  74. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.Tests.ps1 +0 -318
  75. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ConfigurationVerifier.psm1 +0 -344
  76. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.Tests.ps1 +0 -1186
  77. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/ReleaseVerifier.psm1 +0 -900
  78. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/SharedVariables.psm1 +0 -139
  79. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/c-test-env-config.json +0 -268
  80. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-deploy-test-env-config.json +0 -700
  81. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/dotnet-test-env-config.json +0 -533
  82. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-deploy-test-env-config.json +0 -290
  83. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/go-test-env-config.json +0 -260
  84. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-deploy-test-env-config.json +0 -511
  85. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/java-test-env-config.json +0 -388
  86. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-deploy-test-env-config.json +0 -419
  87. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/node-test-env-config.json +0 -329
  88. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/php-test-env-config.json +0 -540
  89. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-deploy-test-env-config.json +0 -411
  90. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/python-test-env-config.json +0 -321
  91. package/ci/common-ci/scripts/modules/51DReleaseTestEnvModule/config/test-env-config.json +0 -457
  92. package/ci/common-ci/scripts/modules/51DRestModule/51DRestModule.psm1 +0 -38
  93. package/ci/common-ci/scripts/modules/AzurePortalModules/51DApplicationInsightsModule/51DApplicationInsightsModule.psm1 +0 -104
  94. package/ci/common-ci/scripts/modules/AzurePortalModules/51DChecksModule/51DChecksModule.psm1 +0 -68
  95. package/ci/common-ci/scripts/modules/AzurePortalModules/51DCloudModule/51DCloudModule.psm1 +0 -155
  96. package/ci/common-ci/scripts/modules/AzurePortalModules/51DConnectAzureModule/51DConnectAzureModule.psm1 +0 -45
  97. package/ci/common-ci/scripts/modules/AzurePortalModules/51DSSLBindingsModule/51DSSLBIndingsModule.psm1 +0 -100
  98. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStagingSlotModule/51DStagingSlotModule.psm1 +0 -50
  99. package/ci/common-ci/scripts/modules/AzurePortalModules/51DStorageAccountModule/51DStorageAccountModule.psm1 +0 -248
  100. package/ci/common-ci/scripts/modules/AzurePortalModules/51DTrafficManagerModule/51DTrafficManagerModule.psm1 +0 -58
  101. package/ci/common-ci/shared-auto-complete-pr-stage.yml +0 -61
  102. package/ci/common-ci/shared-create-tag-job.yml +0 -23
  103. package/ci/common-ci/shared-docker-build-steps.yml +0 -34
  104. package/ci/common-ci/shared-docker-push-steps.yml +0 -32
  105. package/ci/common-ci/shared-docker-test-http-steps.yml +0 -69
  106. package/ci/common-ci/shared-git-tag-job.yml +0 -38
  107. package/ci/common-ci/shared-git-version-job.yml +0 -71
  108. package/ci/common-ci/shared-publish-github-stage.yml +0 -107
  109. package/ci/common-ci/shared-submodule-trigger-stage.yml +0 -110
  110. package/ci/common-ci/shared-variables.yml +0 -7
  111. package/ci/common-ci/trigger-release-apis.yml +0 -39
  112. package/ci/create-packages.yml +0 -109
  113. package/ci/deploy-external.yml +0 -55
  114. package/ci/deploy-internal.yml +0 -50
  115. package/ci/shared-build-and-test-platforms.yml +0 -26
  116. package/ci/shared-build-and-test-stage.yml +0 -128
  117. package/ci/shared-variables.yml +0 -1
  118. package/ci/submodule-trigger.yml +0 -12
@@ -1,365 +0,0 @@
1
- # Common-CI
2
- Common-CI project contains a guideline for creation of continuous integration scripts and describes a general approach to continuous integration within 51Degrees. This readme should provide a comprehensive overview of rules and conventions to be expected from existing jobs and which should be followed when new jobs are created.
3
-
4
- **NOTE**: A Release Engineer following this guide should first check the `internal-ci` readme to understand the 51Degrees release process.
5
-
6
- # Table of content
7
- - [Common-CI](#common-ci)
8
- - [Table of content](#table-of-content)
9
- - [Reasoning](#reasoning)
10
- - [Continuous integration](#continuous-integration)
11
- - [Approach](#approach)
12
- - [Overview](#overview)
13
- - [Build and test](#build-and-test)
14
- - [Create packages](#create-packages)
15
- - [Naming convention](#naming-convention)
16
- - [Azure DevOps Pipelines](#azure-devops-pipelines)
17
- - [Development guideline](#development-guideline)
18
- - [Microsoft Azure DevOps Pipelines](#microsoft-azure-devops-pipelines)
19
- - [YML file](#yml-file)
20
- - [Build and test platforms](#build-and-test-platforms)
21
- - [Testing principles](#testing-principles)
22
- - [Additional documentation](#additional-documentation)
23
- - [APIs common templates](#apis-common-templates)
24
- - [Continuous deployment](#continuous-deployment)
25
- - [Configuration](#configuration)
26
- - [Internal package managers](#internal-package-managers)
27
- - [Release process](#release-process)
28
- - [Packages release](#packages-release)
29
- - [External package managers and public repositories](#external-package-managers-and-public-repositories)
30
- - [Automation](#automation)
31
- - [Fully automated release process](#fully-automated-release-process)
32
- - [Additional pipelines:](#additional-pipelines)
33
- - [Updating the Release Configuration](#updating-the-release-configuration)
34
- - [Fully automated deployment trigger procedure:](#fully-automated-deployment-trigger-procedure)
35
- - [Automated Release Scripts](#automated-release-scripts)
36
- - [Flow Chart](#flow-chart)
37
- - [Naming convention](#naming-convention-1)
38
- - [Azure DevOps Pipelines](#azure-devops-pipelines-1)
39
- - [License](#license)
40
-
41
- # Reasoning
42
- In order to keep high hygiene of development work and have clear indication of successful build, test and package creation, a common set of rules should be followed to measure the quality in a consistent manner across all of the projects. The main reason for having continuous integration in 51Degrees is to assure the best possible quality of software products by confirming successful execution of unit, functional, regression and example tests whenever change to the code base is made. Apart from the code related test, other measures prove the quality of software development through verification of successful execution of build and test processes on all supported platforms and architectures.
43
-
44
- The reason for this document is to describe the technical solutions used for continuous integration in 51Degrees as well as provide a clear guidance on common rules across:
45
- - Naming conventions;
46
- - Compulsory elements of CI scripts;
47
- - Platforms and environments;
48
- - Requirements for additional documentation;
49
-
50
- # Continuous integration
51
- ## Approach
52
- ### Overview
53
- This section describes the general approach to continuous integration in 51Degrees.
54
-
55
- As an internal repository management system 51Degrees is using the Azure DevOps services and continuous integration is achieved through Azure DevOps Pipelines. Each pipeline is defined by a single or multiple `yml` scripts. High maintainability of continuous integration is achieved by keeping the tasks shared between the jobs in separate `yml` scripts and reuse them when possible to avoid code duplications and “copy & paste” errors.
56
-
57
- 51Degrees is using continuous software development practices described in principle as [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
58
-
59
- At least two main continuous integration jobs should be provided for each software project/repository:
60
- - “[Build and test](#build-and-test)”, and
61
- - “[Create packages](#create-packages)”
62
-
63
- Binaries built by continuous integration should be configured to perform a release built by default. If debug build configuration is required, additional, explicit jobs should be created to clearly indicate that pipeline output will be in debug mode.
64
-
65
- ### Build and test
66
- Build and test job should be used for general purpose building and testing process, and should be the initial step of “Build, test and publish”. Continuous integration should be configured to automatically trigger this type of job whenever pull request is created regardless of the destination branch. Job should be automatically performed whenever any code change is made to the active pull request.
67
-
68
- Build and test job provides tasks required for the project to build and run unit and regression tests. This job usually runs a sequence of tasks:
69
- - Configuration<br />
70
- This task (or tasks) configures the environment to meet the build requirements. Task should install all dependencies and platform specific packages required for the build and test processes.
71
- - Code checkout<br />
72
- Task to checkout the source code from the version control system. 51Degrees is using Git repositories hosted on Azure DevOps platform: `git clone` with, where required, submodules initialisation (`git submodule update --init --recursive`) should be used.
73
- - Build<br />
74
- Language and project specific build tool execution.
75
- - Test (and publish the results)<br />
76
- Language and project specific unit, functional, example, or regression testing execution.
77
-
78
- Set of tasks may differ between projects due to a requirement of individual approach for language or platform specific solutions. If an individual solution is in place, it should be documented in the `ci/readme.md` file of the given project.
79
-
80
- Job <b>must</b> indicate a <b>fail state</b> if any of the following occurs:
81
- - Configuration step fails on installation of any of the dependencies
82
- - Code checkout step fails regardless of the reason
83
- - Build step fails with error or warning - all warnings should be treated as errors
84
- - Any test fails
85
-
86
- If multiple operating system platforms should be supported according to [version support table](https://51degrees.com/documentation/_info__version_support.html) “Build and test” job should either:
87
- - implement support for each operating system in a single `yml` file, or
88
- - implement support for each operating system in a separate `yml` file and create a combining `yml` script.
89
-
90
- General guideline for selecting the approach is to keep the `yml` file in a consumable size; if environment configuration, build, test, and any platform specific tasks sums up to more than 4 tasks - create a separate `yml` file. Try to use multi-platform matrix configuration whenever possible, more details can be found in [Microsoft documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-multiplatform?view=azure-devops)
91
-
92
- <i>Note: Build and test job should be configured in a separate `yml` file to allow performing the set of tasks defined in this job as a part of "Build, test and publish" job.</i>
93
-
94
- ### Create packages
95
- Create packages job should be used for creation of packages or tagging the repository and continuous integration system should be configured to automatically execute this job whenever pull request from `release` or `hotfix` branch is merged to `main` branch (as described in [gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)).
96
-
97
- Create packages job performs any tasks required for creation of packages and/or repository version tag. This job usually runs a sequence of tasks which differ for creating the packages and tagging the repository. <br />
98
-
99
- Typical tasks for packages creation:<br />
100
- - Package creation<br />
101
- Language and project specific task generating the packages for given language and/or platform. This task should be documented in project specific `ci/readme.md` file.
102
- - Digital signing<br />
103
- This task should digitally sign the generated binaries or packages to assure a high level of quality and trust for the end user.
104
- - Publish artifacts<br />
105
- Packages or binaries produced by [Build, test and publish](#build,-test-and-publish) job should be published as artifacts of the Azure DevOps Pipeline execution. This task is important to support a smooth release process where the product of this step is used as the final release package.
106
-
107
- Typical tasks for creating a repository tag:<br />
108
- - Determine repository version number<br />
109
- This step should determine the version number to be used for repository tagging. 51Degrees is using [GitVersion](https://gitversion.readthedocs.io/en/latest/input/docs/build-server-support/build-server/azure-devops/) Azure DevOps plugin to identify the repository version based on the [gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
110
- - Tag the repository<br />
111
- Perform `git tag` operation on the repository using the version number determined in the previous step and `push` the newly created tag to remote.
112
-
113
- Job <b>must</b> indicate a <b>fail state</b> if any of the following occurs:
114
- - Package creation fails
115
- - Digital signature process fails
116
- - Artifacts cannot be found or published
117
-
118
- ## Naming convention
119
- ### Azure DevOps Pipelines
120
- There are two main jobs per pipeline: `build and test`, and `create packages` the common naming convention is as follows:
121
- - For “build and test” job:<br />
122
- `<package-name>-test` where `<package-name>` represents dash-separated repository name; for example for repository `pipeline-python`, “build and test” job name should be configured as `pipeline-python-test`.
123
- - For “create packages” job when packages are created:<br /> `<package-name>-create-packages`, where `<package-name>` represents dash-separated repository name; for example for repository `pipeline-python`, “build, test and publish” job name should be configured as `pipeline-python-create-packages`.
124
- - For “create packages” job when repository is only tagged:<br />
125
- `<package-name>-tag-repository`, where `<package-name>` represents dash-separated repository name; for example for repository `location-php`, “build, test and publish” job name should be configured as `location-php-tag-repository`.
126
- - For jobs in debug configuration:<br />
127
- `<package-name>-<job>-debug`, where `<package-name>` represents dash-separated repository name, `<job>` represents job suffix selected above; for example for repository `device-detection-dotnet`, “build, test and publish” job in `debug` the name should be configured as `device-detection-dotnet-create-packages-debug`.
128
-
129
- ## Development guideline
130
- ### Microsoft Azure DevOps Pipelines
131
- Detailed documentation and useful information about Azure DevOps pipelines can be found in [Microsoft documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops).
132
- ### YML file
133
- YAML Ain't Markup Language configuration files are used to configure Azure DevOps continuous integration pipelines and more details about how to use them can be found in [Microsoft documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema).
134
-
135
-
136
- This guideline obligates the CI developer to add comments to any tasks defined in `yml` files that are not self descriptive and requires more information to understand the implemented process. Follow the general rule that “if in doubt - comment” and always ask for peer review in order to address any concerns or possible misunderstandings.
137
-
138
- Comments in `yml` files are achieved by `#` character prefix, for example:<br />
139
- Visual Studio build task from `pipeline-dotnet` project:
140
- ```
141
- - task: VSBuild@1
142
- displayName: 'Build solutions'
143
- inputs:
144
- solution: '$(RestoreBuildProjects)'
145
- vsVersion: '15.0'
146
- platform: 'Any CPU'
147
- configuration: '$(BuildConfiguration)'
148
- clean: true
149
- ```
150
- Although relatively self descriptive, could be extended by comments:
151
- ```
152
- # Visual studio build task - VS2017 configuration
153
- - task: VSBuild@1
154
- displayName: 'Build solutions' # defines name of the task displayed in Azure DevOps
155
- inputs: # Task specific inputs
156
- solution: '$(RestoreBuildProjects)' # Location of solution file obtained from RestoreBuildProjects variable set by previous NuGet restore step
157
- vsVersion: '15.0' # Version of Visual Studio to be used (version 15.0 is VS2017)
158
- platform: 'Any CPU' # Target platform
159
- configuration: '$(BuildConfiguration)' # Build configuration as set by strategy matrix at the top of this file
160
- clean: true # Should we clean?
161
- ```
162
-
163
- ### Build and test platforms
164
- 51Degrees provides information about supported platforms and language/API versions. The full table is available on [51Degrees documentation website](https://51degrees.com/documentation/index.html) on [Information/Version support page](https://51degrees.com/documentation/_info__version_support.html). Azure DevOps Pipelines should be configured to at least mirror the requirements setup by the documentation. If platform architecture is not specified in the support version matrix, it is assumed that both 32 and 64 bit platforms are supported and relevant continuous integration jobs should be provided (please ignore 32bit architecture for the operating systems not supporting x86 platforms). If any changes are applied, support removed or added, either the documentation table or CI configuration must be updated to assure full synchronization between the two.
165
- ### Testing principles
166
- Whenever testing environment is set up for a project, continuous integration scripts should be configured to perform full set of tests for:
167
- - All platforms supported by the software project
168
- - All architectures supported by the operating system (Linux 32/64bit; Windows 32/64bit; MacOS 64bit)
169
- - All variants of configuration (e.g. for APIs all performance profiles)
170
- - Both debug and release build configurations
171
- ### Additional documentation
172
- This guideline covers high-level overview and basic principles for continuous integration configuration in 51Degrees. Due to the nature of software products supported and provided by the company, different approaches may be required for various types of platforms, languages, APIs and their versions. Therefore, this document should be treated as the guideline and any project specific configuration that alters the information provided by this document should be explained in the `readme.md` file stored under the `ci` folder of the given project. Repository containing this document should be added as a submodule to any project that contains Continuous Integration pipeline configured within 51Degrees Azure DevOps environment. Example directory tree expected in the project:
173
- ```
174
- <project_root>
175
- \ci
176
- \common-ci
177
- \readme.md
178
- \readme.md
179
- \build-and-test.yml
180
- \build-and-publish.yml
181
- ```
182
- Language specific configuration should be documented in a `readme.md` file stored under the corresponding folder of the repository `common-ci`. Example directory tree of `common-ci` for `readme.md` files:
183
- ```
184
- \common-ci
185
- \readme.md
186
- \java
187
- \readme.md
188
- \dotnet
189
- \readme.md
190
- ...
191
- ...
192
- ```
193
- ### APIs common templates
194
- When tasks are replicated across APIs, they should be made as templates and kept in the `common-ci` repository. Templates that are shared across languages are kept at the root directory of `common-ci` and templates which are only shared within a language APIs should be kept in its distinct folder, named with the language name. Below is an illustration of the of `common-ci` directory structure:
195
- ```
196
- \common-ci
197
- \readme.md
198
- \languages-common-template.yml
199
- ...
200
- \java
201
- \java-apis-common-template.yml
202
- ...
203
- ...
204
- ```
205
-
206
- # Continuous deployment
207
- ## Configuration
208
- Continuous deployment in 51Degrees is configured to continuously publish packages to the internal package manager feed available in Azure DevOps Artifacts service. Deployment is configured to create and publish the packages internally on a daily basis (overnightly) so that the latest version is available for development purposes.
209
-
210
- All of the packages for daily continuous deployment are created based on the latest version of the `develop` repository branch.
211
- ### Internal package managers
212
- 51Degrees is using Azure DevOps services for continuous integration and deployment configuration. Azure DevOps provides internal repository managers for the main languages supported by 51Degrees APIs:
213
- - NuGet
214
- - Maven
215
- - NPM
216
- - PyPi
217
-
218
- Deployment to internal package managers is performed daily (overnightly) based on changes applied to `develop` branches of the source code repositories.
219
-
220
- ## Release process
221
-
222
- Refer to the `internal-ci` readme for instruction on 51Degrees release process.
223
-
224
- ### Packages release
225
- Packages release process in 51Degrees is handled through Azure DevOps and the deployment to the public repositories is performed manually using packages generated by [Create packages](#create-packages) continuous integration job. As explained in “[Create packages](#create-packages)” section, process of creating the packages is automatically triggered by completion of pull request to the `main` branch of the repository. Created packages are stored as artifacts in Azure DevOps Artifacts and are used in internal release pipelines in order to upload them to the public package managers/repositories.
226
-
227
- API release process steps:
228
- - PR completed to the `main` branch.
229
- - Automatic execution of [build, test and publish](#build,-test-and-publish) job.
230
- - Automatic trigger for release pipeline:
231
- - Automatic upload to internal package manager
232
- - Manual deployment to public package manager/repository
233
-
234
- ### External package managers and public repositories
235
- 51Degrees provides APIs for a selection of programming languages and packages are available on the following public package managers:
236
-
237
- - [NuGet](https://www.nuget.org/profiles/51Degrees)
238
- - [Maven](https://mvnrepository.com/artifact/com.51degrees)
239
- - [Packagist](https://packagist.org/packages/51degrees/)
240
- - [NPM](https://www.npmjs.com/~51degrees)
241
- - [PyPi](https://pypi.org/search/?q=51degrees) (and [TestPyPi](https://test.pypi.org/search/?q=51degrees))
242
- - Source code on [Github](https://github.com/51Degrees/)
243
-
244
- ## Automation
245
-
246
- ### Fully automated release process
247
-
248
- The release process uses the following flow:
249
- 1. Changes are prepared in `release|hotfix` branches.
250
- 2. Switch `AutomatedRelease` variable in `CIAutomation` variable group to `On`.
251
- 3. `Trigger release` job starts; or all `leaf submodules` are manually or automatically merged to `main|master`.
252
- 1. Since `common-ci` is a submodule of all APIs, this is normally done by having `common-ci` `release|hotfix` branch merged to `main`.
253
- 2. To merge `common-ci` `release|hotfix` branch to `main`, creating a pull request to `main` is enough since the pull request will be automatically completed at the end of the pull request `build-and-test` check. This is done by a task that calls a set of APIs in `Release` modules.
254
- 4. All `leaf submodules` `release|hotfix` branches are merged to `main`.
255
- 1. NOTE: `leaf submodules` are modules which do not have any dependencies.
256
- 5. Completion of submodule merging triggers tag and packages deployment of the submodules. If module does not generate packages, then it will be the tag creation step.
257
- 6. Tag and package deployment (or creation) completion triggers `submodule_trigger` pipelines of the parent APIs, which will then update submodule references, package dependencies versions and create a pull request to `main` if one does not exist.
258
- 7. The pull request of parent APIs will then again be completed once the `build_and_test` check passes.
259
- 8. Completion of merging `release|hotfix` branches to `main` will also trigger `deployment` of packages both internally and externally in the same way that the submodules were done.
260
- 9. At the end of the `release` process, packages are available to be collected internally; and `deployment` to external repositories are left to be approved by `release engineer`.
261
- 10. Switch `AutomatedRelease` variable in `CIAutomation` variable group to `Off` to prevent any accidental references update or pull request completion after this stage.
262
-
263
- The fully automated release process is controlled by a `release-config.json` file, located in the `common-ci` repository. There also exists a `release-config-template.json` which contains all settings and APIs that can be included in a `release-config.json`. The automated release process can also be enabled or disabled by a global variable `AutomatedRelease` as part of the Azure Devops variable group `CIAutomation`. To support automating the deployment process, powershell scripts and additional pipelines are required. These scripts are located under `common-ci` repository, and are grouped into modules. The additional pipelines are required per API, but shared templated can be reused from `common-ci`.
264
-
265
- ### Additional pipelines:
266
- - The `submodule trigger` pipeline is required for each API to pick up the package deployment from each of its submodules. Since a module can have multiple submodules, multiple triggers might happen at the same time. Thus, this pipeline should cancel all previous builds and only run one at a single time.
267
- - This must be triggered only by a submodule deployment that happened on the 'main' branch.
268
- - This pipeline, will then perform update of all submodule references and package dependencies, using the versions specified in the `release-config.json`.
269
- - The `pull request completion` job is required to be done at the end of each `build and test` pipeline.
270
- - This will check if the current build is triggered by a pull request from `release|hotfix` branch to the `main` branch. If it is and the following conditions have been met, it then proceed to complete the corresponding pull request.
271
- - The `AutomatedRelease` variable has been enabled.
272
- - All submodule references and package dependencies have been updated.
273
- - The pull request has been approved and comments have been left unresolved; or approval is not required.
274
- - Both of the above pipelines will not proceed if a tag already exists for a release version.
275
-
276
- ### Updating the Release Configuration
277
-
278
- The release configuration files must be updated to configure which repositories will be released. Each repository can be configured with the following fields:
279
-
280
- **Files to update:**
281
-
282
- - `release-config.json`
283
- - `cloud-release-config.json`
284
-
285
- Property|Type|Description
286
- -|-|-
287
- version|string|The target version of this repository, e.g. the version to release or the current version if a release version does not exist. Should be a valid Semantic Version e.g. `4.3.1`
288
- packageName|string|The name of the package that this repository contains code for. E.g. FiftyOne.Pipeline
289
- versionVariableName|string|The variable name used in pipelines to update dependencies.
290
- isLeaf|boolean|Is this a leaf of the dependency tree, i.e. does this repository have no dependencies?
291
- dependencies|string[]|A list of dependencies, these are the names of the repositories that this one is dependent on or contains dependencies of the contained projects.
292
-
293
- While the cloud release **is not** triggered by the automated API release, the `cloud-release-config.json` file will also need to be updated in preparation for the cloud release the following week. Only the version numbers must be updated in this file.
294
-
295
- A `release-config-template.json` file is provided which contains configurations for all the repos with a release pipeline, this should be used as a reference to modify the release config files. Only edit this file if adding a new repo configuration and updating dependencies.
296
-
297
- **Rules**
298
-
299
- There are some **rules** that a release engineer will need to pay attention to when updating the file:
300
- 1. `packageName`: This name is used to search for matching package reference in a package file of a target language. This is used as part of a regular expression search so regex syntax can also be used. Most of the time, the value will just be a prefix of the package name since an API usually uses unique prefix such as `FiftyOne.DeviceDetection`. However, there are APIs which use more than one prefixes such as `license-dotnet`, where `FiftyOne.License` and `FiftyOne.Resource` are used. In this specific case, the value of a `packageName` can be `FiftyOne.(License|Resource)`. Currently `DotNet` is only one which tests and supports regex `packageName`. Others language APIs have unique package `prefix` so regex is not required.
301
- 2. `dependencies`: When specify dependencies, make sure the definition of the dependencies are also specified, so that the release process can detect what tag to update to for submodule reference or what version to be updated for package dependencies. Failing to include the dependency definition will result in submodule references and package dependencies not being updated.
302
- 1. A `dependency` can be either a submodule or a package dependency.
303
-
304
- **Validation**
305
-
306
- Once the files have been updated, they can be validated by running the following PowerShell commands:
307
-
308
- - `Get-Content release-config.json | Out-String | ConvertFrom-Json` - Test JSON is valid
309
- - `Test-Json -Json "$(Get-Content .\release-config.json)" -SchemaFile .\release-config-schema.json` - Test the file matches the release-config schema.
310
-
311
- Steps to make changes and update the release config in common-ci repo:
312
- 1. create new hotfix / release branch in common-ci and push to the remote -
313
- 1. When determining the branch name for the common-ci hotfix or release branch, typically the version should be the same MAJOR and MINOR version of the API releases however the PATCH version does not need to match and should simply be incremented from the previous version in common-ci. See [validating branch names](#validate-the-release--hotfix-branch-names).
314
- 2. create new feature branch for release config in common-ci and push to the remote
315
- 3. update release config with repos, deps and versions for both
316
- 4. commit modified release config to feature branch and create a pr from the feature branch into the release / hotfix branch.
317
-
318
- ### Fully automated deployment trigger procedure:
319
- 1. At the start, `release engineer` will need to update the `release-config.json` to specify all release packages and their target release version. Any additional details should also be specified.
320
- 1. NOTE: There is a `release-config-template.json` available for references.
321
- 2. Once the `release-config.json` is ready in one of the `release|hotfix` branch of `common-ci`, either the following should trigger the release process:
322
- 1. Complete the pull request that contains the updated `release-config.json` changes to the `main` branch. This will only work based on the assumption that the `common-ci` is specified as submodule of all release APIs.
323
- 1. This pull request can be completed manually or automatically by the `build-and-test.yml` auto completion pull request task. The automatic completion is only enabled if the global variable `AutomatedRelease` specified in the variables group `CIAutomation` is set to `On`.
324
- 2. Trigger the `trigger-release` pipeline of the `common-ci` against the hotfix or release branch.
325
-
326
- ### Automated Release Scripts
327
- As briefly mentioned, the automated release process requires powershell scripts to support tasks that have been done manually. These scripts are located in the directory `scripts/modules` of the `common-ci` repository.
328
-
329
- Testing of the release process is done using both script tests and manual testing.
330
- 1. Each module has a set of tests. Since it is the nature of the powershell script to contain many call to utility tools which make it difficult to mock and test effectively. Therefore, where it is not possible to test, the `test` file is left empty as a place holder for the future usage.
331
- 1. To run the tests, firstly `Pester` module is required. `Pester` is included in powershell environment by default. However it is recommended to install the latest version.
332
- 2. Updated the environment variables and authorization string as mentioned in the `Manual testing` section below.
333
- 3. Set the environment `$Env:51D_ENVIRONMENT` to `Test` to ensure that no tests is writing or changing the production environment.
334
- 4. Load the modules by setting `$Env:PSModulePath` ( and using `Import-Module` command if it is needed) in a powershell terminal.
335
- 5. Navigate to `scripts/modules` path and run the following command:
336
- 1. ``` Invoke-Pester ```
337
- 2. To run each module test, run the above command in each module folder.
338
- 2. Manual testing involves creation of test environment so that the release process can be completed and examined without effecting the production environment.
339
- 1. To create a test environment, use the `New-TestEnvironment` function provided in the `51DReleaseTestEnvModule` with an input configuration file. There are many example of how a configuration file looks like in the `51DReleaseTestEnvModule` `config` folder.
340
- 1. The module is mainly used locally but can also be integrated as part of the `Azure Devops` pipelines yaml. However, since the configuration file might be adjusted often to provide a test environment that is suitable for certain scenarios, it is the best to use the script locally.
341
- 2. To use the module locally, the `$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI` and `$env:SYSTEM_TEAMPROJECTID` as guided in the `SharedVariables.psm1` of `51DReleaseTestEnvModule` should be updated accordingly. The `AuthorizationString` of the `51DAuthorizationModule` is also required to be updated. More details can be found in each module file.
342
- 3. The test environment also requires a separate `artifact` feed. Creation of test `artifact` feed is done manually. Once it is created, the `InternalFeedName` and `InternalFeedId` of the variables group `CIAutomation` should be updated accordingly.
343
- 4. Once the release process has completed in a test environment, the `release-config.json` used for the release process can be fed into the `Test-Release` function to verify if the output has successfully completed correctly.
344
- 5. To delete the test environment, use the `Clear-TestEnvironment` function of the `51DReleaseTestEnvModule`. The test artifact feed should be deleted manually. As deletion is a dangerous task, be cautious when performing them. The `Clear-TestEnvironment` will prompt to ask for your confirmation together with the target environment before proceed.
345
-
346
- ### Flow Chart
347
- The following Flow Chart can be edited and updated by changing the `release-process.drawio` file.
348
- ![Release Process Flow Chart](release-process.png)
349
-
350
- ## Naming convention
351
- ### Azure DevOps Pipelines
352
- There are two main jobs per pipeline: `deploy internally`, and `deploy externally`. The common naming convention is as follows:
353
- - For “deploy internally” job:<br />
354
- `<package-name>-deploy-internal` where `<package-name>` represents dash-separated repository name; for example for repository `pipeline-python`, “deploy internally” job name should be configured as `pipeline-python-deploy-internal`.
355
- - For “deploy externally” job:<br />
356
- `<package-name>-deploy-external`, where `<package-name>` represents dash-separated repository name; for example for repository `pipeline-python`, “deploy externally” job name should be configured as `pipeline-python-create-packages`.
357
- - For “deploy” job there is no internal or external package repository:<br />
358
- `<package-name>-deploy`, where `<package-name>` represents dash-separated repository name; for example for repository `location-php`, “deploy” job name should be configured as `location-php-deploy`. This normally happens when there is no package management for a target language; or the only package management supported for a language is via publishing the source code to a public Git repository.
359
-
360
- There are other jobs required to support the automated deployment process: `submodule trigger`, and `pull request completion`. The `pull request completion` is required as part of the `build and test` pipeline. Thus, the only required common naming convention is for `submodule trigger` pipeline.
361
- - For “submodule trigger” job:<br />
362
- `<package-name>-submodule-trigger` where `<package-name>` represents dash-separated repository name; for example for repository `pipeline-python`, “submodule trigger” job name should be configured as `pipeline-python-submodule-trigger`.
363
-
364
- # License
365
- License information can be found in the `LICENSE` file available in this repository.
@@ -1,65 +0,0 @@
1
- # Common-ci only contains document, build script and yaml templates
2
- # so no tests is run. However, it is depended by other apis so
3
- # make it complete pull request and trigger modules like other.
4
-
5
- trigger: none
6
-
7
- stages:
8
- # Try to complete the corresponding pull request if
9
- # this is triggered by one.
10
- - stage: Test
11
- displayName: "Test, Check and complete corresponding pull request"
12
-
13
- variables:
14
- - group: CIAutomation # Required to access CI variables
15
-
16
- pool:
17
- vmImage: 'windows-2019'
18
-
19
- jobs:
20
- - job: Test
21
-
22
- steps:
23
- - checkout: self
24
- submodules: recursive
25
- persistCredentials: true
26
-
27
- - powershell: |
28
- # Install all modules
29
- $Env:PSModulePath += ";$($(Get-Location).Path)\scripts\modules"
30
- Write-Host "Module Path: $($Env:PsModulePath)"
31
-
32
- # Make sure all modules are loaded
33
- cd scripts\modules
34
- Get-ChildItem -Directory | ForEach-Object {
35
- if($(Get-ChildItem $_.FullName | Where-Object {($_ -like '*.psm1') -or ($_ -like '*.psd1')}).length -gt 0) {
36
- Write-Output $_.Name
37
- Import-Module $_.Name -Force
38
- }
39
- }
40
-
41
- # Run all tests
42
- # Enable test environment so that production environment is not impacted
43
- $Env:51D_ENVIRONMENT = "Test"
44
-
45
- Write-Host "# Run all Pester tests."
46
- Invoke-Pester
47
- displayName: 'Run tests'
48
- env:
49
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
50
-
51
- - powershell: |
52
- # Install all modules
53
- $Env:PSModulePath += ";$($(Get-Location).Path)\scripts\modules"
54
- Write-Host "Module Path: $($Env:PsModulePath)"
55
-
56
- # Complete the corresponding pull request
57
- Write-Host "# Try to complete pull request for repository $Env:BUILD_REPOSITORY_NAME."
58
- if (!$(Complete-CorrespondingPullRequest -ConfigFile "$($(Get-Location).Path)\release-config.json")) {
59
- Write-Host "# FAILED"
60
- exit 1
61
- }
62
- displayName: 'Complete Pull Request'
63
- env:
64
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
65
- condition: and(succeeded(), eq(variables['AutomatedRelease'], 'On'))
@@ -1,15 +0,0 @@
1
- variables:
2
- # Target Microsoft Toolset versions. Can't use full extended name
3
- # as this is converted to environment variable and impact tools such as
4
- # CMake
5
- - name: plfTsVer # Platform Toolset Version.
6
- value: 'v142'
7
- # Visual Studio version. This should be consistent with platform toolset
8
- # Used by Gyp where platform toolset version is not available to be set
9
- # 2017 - v141
10
- # 2019 - v142
11
- # 2022 - v143
12
- - name: msvsVer
13
- value: '2019'
14
- - name: winSDKVer # Windows SDK Version.
15
- value: '10.0.19041.0'
@@ -1,56 +0,0 @@
1
- trigger: none
2
-
3
- # Don't trigger for a pull request
4
- pr: none
5
-
6
- stages:
7
-
8
- - stage: Merge_Message
9
- jobs:
10
- - job: Merge_Message
11
-
12
- variables:
13
- # Access token for the git repository. Used by the git tag task.
14
- - name: system_accesstoken
15
- value: $(System.AccessToken)
16
-
17
- pool:
18
- vmImage: 'windows-latest'
19
-
20
- steps:
21
- # The lines below are needed to allow the pipeline access to the
22
- # OAuth access token that controls write access to the git repository.
23
- # (Required for GitTag task)
24
- - checkout: self
25
- persistCredentials: true
26
-
27
- - task: PowerShell@2
28
- inputs:
29
- targetType: 'inline'
30
- script: |
31
- # Get the name of the repo from the PR.
32
- $repoUrl = "$(System.PullRequest.SourceRepositoryURI)"
33
- $repoUrlParts = $repoUrl.Split("/")
34
- $repoName = $repoUrlParts[$repoUrlParts.Length - 1]
35
- $url = "https://dev.azure.com/51degrees/pipeline/_apis/git/repositories/$repoName/pullrequests/$(System.PullRequest.PullRequestId)?api-version=6.0"
36
- # Get the PR.
37
- $pr = Invoke-RestMethod -Uri $url `
38
- -Headers @{
39
- Authorization = "Bearer $(System.AccessToken)"
40
- }
41
- # Get the title of the PR and check that it matches the expected format.
42
- $title = $pr.title
43
- $found = $title -match "Merge branch '.*'"
44
- if ( $found -eq $false) {
45
- # The format does not match, so fail the build.
46
- $errMsg = ("The expected format for the title should be either of the following:`n" +
47
- "`tMerge branch '[source branch name]'`n" +
48
- "`tMerge branch '[source branch name]' into '[target branch name]'`n" +
49
- "`n" +
50
- "Any other format will not be accepted, including:`n" +
51
- "`tMerge branch [source branch name]`n" +
52
- "`tMerge branch `"[source branch name]`"")
53
- Write-Error $errMsg
54
- exit 1
55
- }
56
- failOnStderr: true
@@ -1,51 +0,0 @@
1
- {
2
- "repositories": {
3
- "common-ci": {
4
- "version": "4.3.16",
5
- "isLeaf": true
6
- },
7
- "pipeline-dotnet": {
8
- "version": "4.3.7",
9
- "packageName": "FiftyOne.Pipeline",
10
- "isLeaf": true
11
- },
12
- "entitlement-dotnet": {
13
- "version": "4.1.12",
14
- "isLeaf": true
15
- },
16
- "location-dotnet": {
17
- "version": "4.3.6",
18
- "packageName": "FiftyOne.Geolocation",
19
- "isLeaf": true
20
- },
21
- "device-detection-dotnet": {
22
- "version": "4.3.7",
23
- "packageName": "FiftyOne.DeviceDetection",
24
- "isLeaf": true
25
- },
26
- "internal-engines-dotnet": {
27
- "version": "4.3.3",
28
- "packageName": "FiftyOne.GeoLocation.OnPremise",
29
- "isLeaf": true
30
- },
31
- "cloud-config": {
32
- "version": "4.3.0",
33
- "isLeaf": true
34
- },
35
- "cloud-dotnet": {
36
- "version":"4.3.2",
37
- "packageName": "FiftyOne.Pipeline.CloudService",
38
- "isLeaf": false,
39
- "dependencies": [
40
- "common-ci",
41
- "pipeline-dotnet",
42
- "entitlement-dotnet",
43
- "internal-engines-dotnet",
44
- "device-detection-dotnet",
45
- "location-dotnet",
46
- "cloud-config"
47
- ]
48
- }
49
- },
50
- "approvalRequired": false
51
- }
@@ -1,44 +0,0 @@
1
- trigger:
2
- - main
3
- - develop
4
- - release/*
5
-
6
- # Don't trigger for a pull request
7
- pr: none
8
-
9
- # Include shared variables
10
- variables:
11
- - template: shared-variables.yml
12
-
13
- stages:
14
-
15
- - stage: Tagging
16
-
17
- jobs:
18
- - job: Tagging
19
-
20
- pool:
21
- vmImage: $(linuxImage)
22
-
23
- steps:
24
- - checkout: self
25
- submodules: recursive
26
- persistCredentials: true
27
-
28
- - task: gitversion/setup@0
29
- displayName: Install GitVersion
30
- inputs:
31
- versionSpec: '5.x'
32
-
33
- - task: gitversion/execute@0
34
- displayName: Determine Version
35
- inputs:
36
- useConfigFile: true
37
- configFilePath: '$(Build.SourcesDirectory)/GitVersion.yml'
38
-
39
- # Add a tag to the git repository with the version number.
40
- - task: ATP.ATP-GitTag.GitTag.GitTag@5
41
- displayName: 'Tag Repo With Version Number'
42
- inputs:
43
- tagUser: 'Azure DevOps'
44
- tagEmail: 'CIUser@51Degrees.com'
@@ -1,25 +0,0 @@
1
- # Disable automatic runs of this pipeline when changes are pushed to the repository.
2
- trigger: none
3
-
4
- # Disable automatic runs of this pipeline when a PR is create.
5
- pr: none
6
-
7
- # Include shared variables
8
- variables:
9
- - template: shared-variables.yml
10
-
11
- # Add the pipeline that builds the packages as a resource.
12
- # This allows the deployment pipeline to be triggered whenever
13
- # the build pipeline completes.
14
- resources:
15
- pipelines:
16
- - pipeline: build-pipeline # The name for the triggering build pipeline within this script
17
- source: common-ci-tag-repository # Name of the pipeline from here: https://51degrees.visualstudio.com/Pipeline/_build
18
- trigger: true
19
-
20
- stages:
21
- - template: shared-publish-github-stage.yml
22
- parameters:
23
- imageName: $(linuxImage)
24
- branchName: 'refs/heads/main'
25
- skipTagging: false
@@ -1,20 +0,0 @@
1
- parameters:
2
- - name: codeSigningPassword
3
-
4
- steps:
5
- # The secure file to download will be stored in the
6
- # Pipelines/Library/SecureFiles section in Azure DevOps.
7
- - task: DownloadSecureFile@1
8
- displayName: 'Download Code Signing Certificate'
9
- name: CodeSigningCert
10
- inputs:
11
- secureFile: '51Degrees Private Code Signing Certificate.pfx'
12
-
13
- # Sign the Nuget package with the file downloaded previously.
14
- # The password is stored in the Pipelines/Library/VariableGroups
15
- # section in Azure DevOps.
16
- - task: NuGetCommand@2
17
- displayName: 'Sign NuGet Package'
18
- inputs:
19
- command: custom
20
- arguments: 'sign $(System.ArtifactsDirectory)\*.nupkg -CertificatePath "$(CodeSigningCert.secureFilePath)" -CertificatePassword ${{ parameters.codeSigningPassword }} -Timestamper http://timestamp.digicert.com'