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

clap-v4 support for hab cli #9330

Merged
merged 7 commits into from
Jan 14, 2025
Merged

Conversation

agadgil-progress
Copy link
Contributor

Starting with some cfg trickery to make sure we continue to build old stuff. Very very experimental.

@agadgil-progress agadgil-progress marked this pull request as draft July 25, 2024 06:22
Copy link

netlify bot commented Jul 25, 2024

👷 Deploy Preview for chef-habitat processing.

Name Link
🔨 Latest commit 79eac74
🔍 Latest deploy log https://app.netlify.com/sites/chef-habitat/deploys/67862ee014fc94000873f271

@agadgil-progress
Copy link
Contributor Author

CHEF-14734

@agadgil-progress agadgil-progress force-pushed the agadgil/hab-sup-clap4-support branch from d4f79d7 to 85003b9 Compare August 14, 2024 08:01
@agadgil-progress agadgil-progress force-pushed the agadgil/hab-sup-clap4-support branch from 88721b2 to bd42815 Compare August 26, 2024 08:44
@agadgil-progress agadgil-progress marked this pull request as ready for review August 26, 2024 10:37
Copy link
Contributor

@mwrock mwrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone over most of the code and these are the only comments I have so far without actually testing. I plan to start testing tomorrow. Do you mind rebasing this PR branch against main?

components/hab/src/cli_v4/pkg/export.rs Show resolved Hide resolved
components/hab/src/cli_v4/pkg/build.rs Show resolved Hide resolved
@agadgil-progress agadgil-progress force-pushed the agadgil/hab-sup-clap4-support branch from bd42815 to ae3bf2e Compare January 7, 2025 04:07
Copy link
Contributor

@mwrock mwrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just some minor but important textual issues in the option descriptions. Also as discussed in a standup call earlier, it would be great if we could deploy v2 and v4 together as long as that could be done without things getting too convoluted or otherwise horrible.

components/hab/src/cli_v4/pkg.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/channels.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/delete.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/demote.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/promote.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/exec.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/header.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/promote.rs Outdated Show resolved Hide resolved
components/hab/src/cli_v4/pkg/uninstall.rs Outdated Show resolved Hide resolved
@agadgil-progress agadgil-progress force-pushed the agadgil/hab-sup-clap4-support branch from 27276c1 to e8b51d3 Compare January 13, 2025 03:53
Starting with some `cfg` trickery to make sure we continue to build old
stuff. Very very experimental.

Signed-off-by: Abhijit Gadgil <[email protected]>

Moved `KeyType` into it's own module

Signed-off-by: Abhijit Gadgil <[email protected]>
Initial skeleton for `hab pkg` command with Clap v4. This functionality
gets enabled only with `v4` feature (off by default). Thus we continue
to work with existing functionality.

- Initial implementation of `hab pkg binds`
- Initial implementation of `hab pkg binlink`
- Initial implementation of `hab pkg path`
- Initial implementation of `hab pkg build`
- Added `hab pkg config` command
- Added `hab pkg env` command
- Added `hab pkg hash` command
- Added `hab pkg header` command
- Added `hab pkg info` command
- Added `hab pkg verify` command

Support for `pkg add bulkupload` command

Also fixed issue with building on macos due to `#[cfg(....)]` in
`do_build`.

Implementation of `hab pkg delete` command

Removed the `hab bldr job` from `main_v2`

- Implemented `hab pkg channels` command
- Implemented `hab pkg demote` command
- Implemented `hab pkg dependencies` command
- Implemented `hab pkg download` command
- Implemented `hab pkg promote` command

Implementation of `hab pkg list` command

Making `v2` or `v4` as default

- `hab pkg exec`
- `hab pkg export`
- `hab pkg provides`
- `hab pkg search`
- `hab pkg sign`
- `hab pkg upload`

- Added `hab pkg install`
- Added `hab pkg uninstall`

All `hab pkg ...` commands completed

Signed-off-by: Abhijit Gadgil <[email protected]>
1. Added Unit tests for `AuthToken` APIs we are using
2. Added Unit tests for `BldrUrl` APIs we are using
3. Added Unit tests for `PkgDownloadOptions`

This covers unit tests for *new* logic we have written during the
porting activities.

Signed-off-by: Abhijit Gadgil <[email protected]>
When exporting a package, if the given package does not exist in the
specified channel (or default channel) we were unwrapping an error,
rather than properly returning it.

Signed-off-by: Abhijit Gadgil <[email protected]>
Rebase with origin/main fix conflicts

Support for refresh channel and `FEATURE_LOCAL` was missing during
rebase added that support to both CLI v2 and CLI v4.

`HabPkgIdentValueParser` validator was not used for `PackageIdent` which
is a struct field in many of the `pkg` commands. Started using it.

Fixed String to Pathbuf and String to PackageIdent conversions in the
validators

Removed the unused CF and Mesos exporters.

Signed-off-by: Abhijit Gadgil <[email protected]>
@agadgil-progress agadgil-progress force-pushed the agadgil/hab-sup-clap4-support branch from e8b51d3 to 79eac74 Compare January 14, 2025 09:31
@agadgil-progress agadgil-progress merged commit 7474412 into main Jan 14, 2025
11 checks passed
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.

2 participants