Repository navigation
Add APM package-manager detection and command support - #51
abhinavgautam01 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
andrew
left a comment
There was a problem hiding this comment.
Thanks for this. The command mappings match the captured help and the APM docs, and the detection entries look right. Two things need changing before it can merge.
PackageBlocklistPolicy does not match owner/repo#ref. match in policy.go strips only a trailing @version, and APM is the first definition with a different version suffix. With owner/repo on the blocklist, an add with version main builds apm install owner/repo#main and is allowed in enforce mode. match needs to strip a trailing #ref as well, with a case for it in policy_test.go.
The package arg on add, remove and update in definitions/apm.yaml has no validate, so a package value of --force becomes apm install --force, which the help describes as deploying despite critical security findings. PolicyRunner skips dash-prefixed args, so no policy sees it either. The existing package_name validator is too narrow here because APM also accepts Git URLs, local paths and NAME@MARKETPLACE. Please add an apm_package validator in validate.go that rejects a leading -, reference it from those three args, and add a test for it.
|
Thanks, both fixed.
|
Closes #50.
Adds a definition for Microsoft APM, checked against the CLI help captured from APM 0.35.1 in
references/apm/.Detection
apm.yml, lockfilesapm.lock.yamland legacyapm.lock. The current lockfile is listed first so it wins when conflicts are allowed.apmecosystem, ordered after conda.GitPkgsFileDetectionPolicyhas a matching entry, so a directory withpyproject.tomlandapm.ymlreturns both uv and apm fromDetectAllFS.Commands
apm init --yesapm install,--frozenfor frozen installsapm install owner/repo[#ref],--devfor development dependenciesapm uninstall owner/repoapm deps listapm outdatedapm update [package] --yesapm deps treeNotes:
apm listlists scripts, so dependency listing usesapm deps list.initwritesapm.ymlin place, checked by running it in an empty directory.updateneeds--yesbecause APM aborts the confirmation prompt without a TTY.outdatedwas not in the issue but APM has it. It exits 0 whether or not anything is outdated.json_outputis not advertised.resolvereturns the rawdeps treetext. Parsing the lockfile is handled by theapmdirectory parser in resolve (Read APM dependency graphs from the lockfile resolve#17).Tests
apm_test.goloads the embedded definition and covers:json_output,pathorvendorGitPkgsFileDetectionPolicyDetectAllFSreturning both uv and apm forpyproject.tomlplusapm.ymlThe README lists apm in the manager table and the init and resolve lists.
Summary by CodeRabbit
owner/repo#main.