Skip to content

Refactor Staging/Production Alternate Host Implementation #655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ronilan
Copy link
Contributor

@ronilan ronilan commented May 19, 2022

Overview

This pull request refactors the implementation of production/staging hosts (see: #533). It includes minor feature changes and is backwards compatible with any previously valid configurations.

This pull request comes "on top" of (i.e. includes changes from) #652 (which in turn comes "on top" of #651, which is "on top" of #648, #649, #650). Work is in preparation for resolving issue #654.

Change

Features

  • Added development_host option. Becomes default option for publish unpublish when present.
  • Changed behavior when alternate hosts are defined. Now production_host acts as alias to host. Defining staging_host or development_host is enough to default publish and unpublish away from production.
  • An invalid s3_host option does not result in error and is instead silently ignored.

Bug Fix #653

  • When a chain of commands that includes publish or unpublish and host is not specifically set via command line or environment variable, all commands in the chain default away from production.

Code

  • Moved logic regarding host selection of host to versioning. This is where all user defined values from package.json are transformed into command options.

Tests

  • Tests of feature where moved from run.test.js to versioning.test.js.
  • Increased test coverage for various options of using the hosts.
  • All tests pass.

@ronilan ronilan force-pushed the Refactor-Staging-Production-Host-533-Fix-653 branch 3 times, most recently from 7381b32 to 4e407be Compare June 30, 2024 21:40
@ronilan ronilan force-pushed the Refactor-Staging-Production-Host-533-Fix-653 branch from 4e407be to fe2e4ba Compare April 23, 2025 21:22
@ronilan ronilan requested a review from a team as a code owner April 23, 2025 21:22
@cclauss
Copy link
Collaborator

cclauss commented Apr 23, 2025

Please rebase now that #900 has been merged and our GitHub Actions are passing again.

@ronilan ronilan force-pushed the Refactor-Staging-Production-Host-533-Fix-653 branch from fe2e4ba to b9538e0 Compare April 24, 2025 06:04
@ronilan ronilan force-pushed the Refactor-Staging-Production-Host-533-Fix-653 branch 2 times, most recently from 911336f to e365c1d Compare April 25, 2025 05:28
ronilan and others added 9 commits April 25, 2025 09:24
…is versa. Removed previous one.

Fix CodeQL errors.
- Added a GitHub Actions workflow that runs whenever there is a push to the repo.
- Workflow includes two jobs:
    - A matrix job of node versions (10, 12, 14, 16, 18) and operating systems (Linux (ubuntu), Mac and Windows (2019 Enterprise)) that runs all tests against mock and then runs s3 tests against a bucket (located at us-east-1-bucket) specified as a repo secret.
    - A matrix job of and NW.js versions (0.64.0, 0.50.2) and node versions (10, 12, ,14, 16) that runs the NW.js test script.
- Moved logic regarding host selection to versioning where all user defined values from package.json are transformed into command options.
- Moved testing of feature from `run.test.js` to `versioning.test.js`.
- Added `development_host` option. Becomes default option for `publish` `unpublish` when present.
- Changed behavior when alternate hosts are defined. Now `production_host` acts as alias to host. Defining `staging_host` or `development_host` is enough to default `publish` and `unpublish` away from production.
- When a chain of commands that includes `publish` or `unpublish`, when host not specifically set via command line or environment variable, ALL commands in the chain default away from production.
- An invalid `s3_host` option does not result in error and is instead silently ignored.
- Change is backwards compatible with previously valid configurations.
@ronilan ronilan force-pushed the Refactor-Staging-Production-Host-533-Fix-653 branch from e365c1d to 7d55567 Compare April 25, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chaining publish and unpublish Commands Changes Their Default Behavior
2 participants