Skip to content
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

[2/] Improvement: Introduce new command structure #16

Merged
merged 26 commits into from
Feb 7, 2024

Conversation

zeyadkhaled
Copy link
Member

@zeyadkhaled zeyadkhaled commented Jan 31, 2024

Part of an effort to improve the osdk cli.
The work to get the improvements across will be done over the followings PRs:
[1/] Add new utility functions
[2/] Introduce new command structure --> this
[3/] Use loadedToken for fetching data

This PR

Deleted the following subfolders under site:

  • versions
  • upload
  • delete

Updated the following subfolder under site:

  • deploy

Added the following subfolders under site:

  • version
    • list
    • set
    • unset
    • delete
    • get

The cli now depends on a the config file (if found) to set default values to arguments and decide on behavior of the commands conflicting.

New Command Structure

If a project config file(foundry.config.json) with required values is provided, most of these commands without additional arguments.

  • osdk unstable site version list List application versions
  • osdk unstable site version set Set the live site version
  • osdk unstable site version unset Clear the currently set live site ve
  • osdk unstable site version delete Delete the specified site version.
  • osdk unstable site version get Get the currently set live site version
  • osdk unstable site deploy Deploy an uploaded version

Considerations

All requests are still being made using FOUNDRY_SDK_AUTH_TOKEN environment variable, the token and tokenFile arguments aren't respected yet. This will be handled in part 3.

@zeyadkhaled zeyadkhaled force-pushed the zka/cli-command-structure branch from b62c622 to 4c5f507 Compare January 31, 2024 15:15
@zeyadkhaled zeyadkhaled force-pushed the zka/cli-command-structure branch 4 times, most recently from f0a9df2 to 9b328c5 Compare February 2, 2024 16:58
Base automatically changed from zka/cli-utils to main February 5, 2024 16:21
@changelog-app
Copy link

changelog-app bot commented Feb 5, 2024

Generate changelog in packages/cli/changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

[2/] Improvement: Introduce new command structure

Check the box to generate changelog(s)

  • Generate changelog entry

@zeyadkhaled zeyadkhaled force-pushed the zka/cli-command-structure branch 3 times, most recently from faf9d93 to 886b2fd Compare February 5, 2024 16:55
packages/cli/src/cli.ts Outdated Show resolved Hide resolved
packages/cli/src/cli.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/handleSiteDeploy.mts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/siteDeployArgs.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/handleSiteDeploy.mts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/handleSiteDeploy.mts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/handleSiteDeploy.mts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/handleSiteDeploy.mts Outdated Show resolved Hide resolved
@zeyadkhaled zeyadkhaled force-pushed the zka/cli-command-structure branch from e8e4a7b to 2816993 Compare February 6, 2024 14:38
packages/cli/src/cli.ts Outdated Show resolved Hide resolved
packages/cli/src/cli.ts Outdated Show resolved Hide resolved
packages/cli/src/util/configLoader.ts Outdated Show resolved Hide resolved
packages/cli/src/util/configLoader.ts Outdated Show resolved Hide resolved
packages/cli/src/util/configLoader.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/version/index.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/index.ts Outdated Show resolved Hide resolved
@zeyadkhaled zeyadkhaled requested a review from tzyl February 7, 2024 12:31
packages/cli/src/commands/site/deploy/index.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/deploy/index.ts Outdated Show resolved Hide resolved
packages/cli/src/yargs/logConfigFileMiddleware.ts Outdated Show resolved Hide resolved
packages/cli/src/yargs/logConfigFileMiddleware.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/site/index.ts Outdated Show resolved Hide resolved
@bulldozer-bot bulldozer-bot bot merged commit 16efd1e into main Feb 7, 2024
5 of 7 checks passed
@bulldozer-bot bulldozer-bot bot deleted the zka/cli-command-structure branch February 7, 2024 13:40
ericanderson added a commit that referenced this pull request Feb 13, 2024
* origin/main:
  Autorelease
  Increase CLI max width to 150 columns (#47)
  Debug log site zip stats (#49)
  Clean up yargs and consola imports (#51)
  Autorelease
  Add generated changelog entries
  Breaking: force dollar sign in osdk verbs for where
  Display errors more consistently in @osdk/cli (#41)
  Fix tagPrefix
  Add generated changelog entries
  Create foundry.config.json in create-app
  [3/] Improvement: Use loadedToken for fetching data (#17)
  Move argv override logging to middleware (#42)
  Make sure to run all tests (#39)
  Update create-app to use FOUNDRY_TOKEN in templates (#40)
  Add generated changelog entries
  Fix intellisense for aggregations and fill in more number types
  [2/] Improvement: Introduce new command structure  (#16)
  Autorelease
  Refactor create-app prompts with tests (#32)
  Refactor create-app dotfile generation (#31)
  add changelog
  Add generated changelog entries
  Add generated changelog entries
  put mkdir in right place
  remove generated files
  add ignore for legacy client
  remove deleted file
  added
  add back mkdir
  move mkdir
  fix
  fixes
  keep trying
  remove module
  shared testing infra for legacy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants