Skip to content

Commit

Permalink
Remove the package_and_publish_release_dryrun workflow (#38533)
Browse files Browse the repository at this point in the history
Summary:
The `package_and_publish_release_dryrun` workflow does the same steps that we are actually already doing in the `tests` workflow.
Both workflows are triggered when `run_nightly_workflow == false && run_release_workflow == false` so the triggering condition **is the same**

The following table highlights and compares the steps performed by the two workflows:

| Package_and_publish_release_dryrun | Tests |
| --- | --- |
| `prepare_package_for_release(version: ‘’, latest: false, dryrun: true)` | |
| `prepare_hermes_workspace` | `prepare_hermes_workspace` |
| `build_hermesc_linux` | `build_hermesc_linux` |
| `build_hermes_macos(flavor: Debug | Release)` | `build_hermes_macos(flavor: Debug | Release)` |
| `build_hermesc_windows` | `build_hermesc_windows` |
| `build_npm_package (release_type: dry-run)` | `build_npm_package(release_type: dry-run)` |

The only missing job in `tests` workflow is `prepare_package_for_release`. This job has the following features:
1. It invokes the `prepare-package-for-release.js` scripts, actually testing it.
2. It doesn’t cache anything,
3. it doesn’t attach any workspace

Due to 2 and 3, it means that it does not influence any job that follow it in the pipeline as they won't access any of the results from this job.

So, we are adding this job in the Test pipeline, so we exercise the `prepare-package-for-release.js` making sure that it works,  and remove
the whole `package_and_publish_release_dryrun` wroflow as it will now be completely duplicated

## Changelog:

[Internal] - Remove the `package_and_publish_release_dryrun` workflow

Pull Request resolved: #38533

Test Plan: CircleCI stays green

Reviewed By: cortinico

Differential Revision: D47633526

Pulled By: cipolleschi

fbshipit-source-id: 28ea9c5944931b992ad07fdeecf08e1d1a86b775
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Jul 30, 2023
1 parent 265f72f commit 62c9aae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 48 deletions.
39 changes: 5 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,11 @@ workflows:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_package_for_release:
name: prepare_package_for_release
version: ''
latest : false
dryrun: true
- prepare_hermes_workspace
- test_ios_rntester_hermes_xcode_integration
- build_hermesc_linux:
Expand Down Expand Up @@ -1939,40 +1944,6 @@ workflows:
- build_hermes_macos
- build_hermesc_windows

package_and_publish_release_dryrun:
when:
and:
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
- prepare_package_for_release:
name: prepare_package_for_release
version: ''
latest : false
dryrun: true
- prepare_hermes_workspace:
requires:
- prepare_package_for_release
- build_hermesc_linux:
requires:
- prepare_hermes_workspace
- build_hermes_macos:
requires:
- prepare_hermes_workspace
matrix:
parameters:
flavor: ["Debug", "Release"]
- build_hermesc_windows:
requires:
- prepare_hermes_workspace
- build_npm_package:
name: build_and_publish_npm_package
release_type: "dry-run"
requires:
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows

analysis:
when:
and:
Expand Down
16 changes: 2 additions & 14 deletions scripts/circle-ci-artifacts-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ async function initialize(circleCIToken, baseTempPath, branchName) {
baseTemporaryPath = baseTempPath;
exec(`mkdir -p ${baseTemporaryPath}`);
const pipeline = await _getLastCircleCIPipelineID(branchName);
const packageAndReleaseWorkflow = await _getPackageAndReleaseWorkflow(
pipeline.id,
);
const testsWorkflow = await _getTestsWorkflow(pipeline.id);
const jobsPromises = [
_getCircleCIJobs(packageAndReleaseWorkflow.id),
_getCircleCIJobs(testsWorkflow.id),
];

const jobsResults = await Promise.all(jobsPromises);
const jobsResults = await _getCircleCIJobs(testsWorkflow.id);

jobs = jobsResults.flatMap(j => j);
}
Expand Down Expand Up @@ -96,10 +88,6 @@ function _throwIfWorkflowNotFound(workflow, name) {
}
}

async function _getPackageAndReleaseWorkflow(pipelineId) {
return _getSpecificWorkflow(pipelineId, 'package_and_publish_release_dryrun');
}

async function _getTestsWorkflow(pipelineId) {
return _getSpecificWorkflow(pipelineId, 'tests');
}
Expand Down Expand Up @@ -165,7 +153,7 @@ async function artifactURLHermesDebug() {
}

async function artifactURLForMavenLocal() {
return _findUrlForJob('build_and_publish_npm_package-2', 'maven-local.zip');
return _findUrlForJob('build_npm_package', 'maven-local.zip');
}

async function artifactURLForHermesRNTesterAPK(emulatorArch) {
Expand Down

0 comments on commit 62c9aae

Please sign in to comment.