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

feat: add more robust 'target resolution' system #227

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

j-lanson
Copy link
Collaborator

The need for the refactor represented by this PR was determined from discussions around tackling #183 .

This PR was a collaborative effort between myself and @mchernicoff .

This PR uses the types defined in target/types.rs for representing the "target" of a HipCheck analysis. Although information can be specified on the cmdline by users in a variety of ways (variants of TargetSeed), we eventually need to arrive at a local clone of a git repository that may or may not have an associated remote repo / package information. This is all encapsulated by the Target struct.

This PR provides glue code for converting cli.rs structures to TargetSeed instances using the ToTargetSeed trait. The resolve_target() function does the work of TargetSeed to Result<Target> translation.

In order to limit the LOC changed by this PR, the generated Target is then translated to the existing Source object in source/query.rs. In a future PR we will do the work of removing the Source ecosystem and fully replacing it with Target.

@j-lanson j-lanson added the type: enhancement New feature or request label Jul 24, 2024
@j-lanson j-lanson self-assigned this Jul 24, 2024
hipcheck/src/session/pm.rs Outdated Show resolved Hide resolved
@alilleybrinker
Copy link
Collaborator

Just the one small nitpick, otherwise this LGTM! Ping me when it's ready for re-review.

@mchernicoff mchernicoff force-pushed the feature/target-type-refactor-squashed branch from af42680 to 4eb2b58 Compare July 25, 2024 00:26
@mchernicoff
Copy link
Contributor

@alilleybrinker I deleted the commented out code. Ready for re-review.

@alilleybrinker alilleybrinker merged commit fd81750 into main Jul 25, 2024
9 checks passed
@j-lanson j-lanson deleted the feature/target-type-refactor-squashed branch July 31, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants