anancarv / python-artifactory

Typed interactions with the Jfrog Artifactory REST API
MIT License
55 stars 50 forks source link

Added terraform backend and helmoci package types #161

Closed dakky closed 3 months ago

dakky commented 4 months ago

Description

This PR added 2 repotypes to the library:

furthermore it added some typing validation for the terraform repository (terraformType), which is a mandatory parameter when adding a terraform repo

Fixes # (issue)

Type of change

Please delete options that are not relevant.

How has it been tested ?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

print("-----------------")

repo = LocalRepository(key="tf-module", packageType="terraform", terraformType="MODULE") newrepo = art.repositories.create_repo(repo) repo = art.repositories.get_repo("tf-module") pprint(repo) art.repositories.delete("tf-module")

print("-----------------")

repo = LocalRepository(key="tf-provider", packageType="terraform", terraformType="PROVIDER") newrepo = art.repositories.create_repo(repo) repo = art.repositories.get_repo("tf-provider") pprint(repo) art.repositories.delete("tf-provider")

print("-----------------")

repo = LocalRepository(key="helmoci", packageType="helmoci") newrepo = art.repositories.create_repo(repo) repo = art.repositories.get_repo("helmoci") pprint(repo) art.repositories.delete("helmoci")

Repository tf-be does not exist LocalRepositoryResponse(key='tf-be', projectKey=None, rclass=<RClassEnum.local: 'local'>, packageType=<PackageTypeEnum.terraformbackend: 'terraformbackend'>, description='', notes='', includesPattern='*/', excludesPattern='', repoLayoutRef='maven-2-default', checksumPolicyType=<ChecksumPolicyType.client_checksums: 'client-checksums'>, handleReleases=True, handleSnapshots=True, maxUniqueSnapshots=0, maxUniqueTags=0, debianTrivialLayout=False, snapshotVersionBehavior=<SnapshotVersionBehavior.non_unique: 'non-unique'>, suppressPomConsistencyChecks=False, blackedOut=False, xrayIndex=False, propertySets=[], dockerApiVersion='V2', archiveBrowsingEnabled=False, calculateYumMetadata=False, yumRootDepth=0, enableFileListsIndexing=False, optionalIndexCompressionFormats=None, downloadRedirect=False, cdnRedirect=False, blockPushingSchema1=True, primaryKeyPairRef=None, secondaryKeyPairRef=None, priorityResolution=False, cargoInternalIndex=False, terraformType='MODULE', enableComposerSupport=False, enableNuGetSupport=False, enableGemsSupport=False, enableNpmSupport=False, enableBowerSupport=False, enableCocoaPodsSupport=False, enableConanSupport=False, enableDebianSupport=False, enablePypiSupport=False, enablePuppetSupport=False, enableDockerSupport=False, forceNugetAuthentication=False, enableVagrantSupport=False, enableGitLfsSupport=False, enableDistRepoSupport=False)

Repository tf-module does not exist LocalRepositoryResponse(key='tf-module', projectKey=None, rclass=<RClassEnum.local: 'local'>, packageType=<PackageTypeEnum.terraform: 'terraform'>, description='', notes='', includesPattern='*/', excludesPattern='', repoLayoutRef='maven-2-default', checksumPolicyType=<ChecksumPolicyType.client_checksums: 'client-checksums'>, handleReleases=True, handleSnapshots=True, maxUniqueSnapshots=0, maxUniqueTags=0, debianTrivialLayout=False, snapshotVersionBehavior=<SnapshotVersionBehavior.non_unique: 'non-unique'>, suppressPomConsistencyChecks=False, blackedOut=False, xrayIndex=False, propertySets=[], dockerApiVersion='V2', archiveBrowsingEnabled=False, calculateYumMetadata=False, yumRootDepth=0, enableFileListsIndexing=False, optionalIndexCompressionFormats=None, downloadRedirect=False, cdnRedirect=False, blockPushingSchema1=True, primaryKeyPairRef=None, secondaryKeyPairRef=None, priorityResolution=False, cargoInternalIndex=False, terraformType='MODULE', enableComposerSupport=False, enableNuGetSupport=False, enableGemsSupport=False, enableNpmSupport=False, enableBowerSupport=False, enableCocoaPodsSupport=False, enableConanSupport=False, enableDebianSupport=False, enablePypiSupport=False, enablePuppetSupport=False, enableDockerSupport=False, forceNugetAuthentication=False, enableVagrantSupport=False, enableGitLfsSupport=False, enableDistRepoSupport=False)

Repository tf-provider does not exist LocalRepositoryResponse(key='tf-provider', projectKey=None, rclass=<RClassEnum.local: 'local'>, packageType=<PackageTypeEnum.terraform: 'terraform'>, description='', notes='', includesPattern='*/', excludesPattern='', repoLayoutRef='maven-2-default', checksumPolicyType=<ChecksumPolicyType.client_checksums: 'client-checksums'>, handleReleases=True, handleSnapshots=True, maxUniqueSnapshots=0, maxUniqueTags=0, debianTrivialLayout=False, snapshotVersionBehavior=<SnapshotVersionBehavior.non_unique: 'non-unique'>, suppressPomConsistencyChecks=False, blackedOut=False, xrayIndex=False, propertySets=[], dockerApiVersion='V2', archiveBrowsingEnabled=False, calculateYumMetadata=False, yumRootDepth=0, enableFileListsIndexing=False, optionalIndexCompressionFormats=None, downloadRedirect=False, cdnRedirect=False, blockPushingSchema1=True, primaryKeyPairRef=None, secondaryKeyPairRef=None, priorityResolution=False, cargoInternalIndex=False, terraformType='PROVIDER', enableComposerSupport=False, enableNuGetSupport=False, enableGemsSupport=False, enableNpmSupport=False, enableBowerSupport=False, enableCocoaPodsSupport=False, enableConanSupport=False, enableDebianSupport=False, enablePypiSupport=False, enablePuppetSupport=False, enableDockerSupport=False, forceNugetAuthentication=False, enableVagrantSupport=False, enableGitLfsSupport=False, enableDistRepoSupport=False)

Repository helmoci does not exist LocalRepositoryResponse(key='helmoci', projectKey=None, rclass=<RClassEnum.local: 'local'>, packageType=<PackageTypeEnum.helmoci: 'helmoci'>, description='', notes='', includesPattern='*/', excludesPattern='', repoLayoutRef='maven-2-default', checksumPolicyType=<ChecksumPolicyType.client_checksums: 'client-checksums'>, handleReleases=True, handleSnapshots=True, maxUniqueSnapshots=0, maxUniqueTags=0, debianTrivialLayout=False, snapshotVersionBehavior=<SnapshotVersionBehavior.non_unique: 'non-unique'>, suppressPomConsistencyChecks=False, blackedOut=False, xrayIndex=False, propertySets=[], dockerApiVersion='V2', archiveBrowsingEnabled=False, calculateYumMetadata=False, yumRootDepth=0, enableFileListsIndexing=False, optionalIndexCompressionFormats=None, downloadRedirect=False, cdnRedirect=False, blockPushingSchema1=True, primaryKeyPairRef=None, secondaryKeyPairRef=None, priorityResolution=False, cargoInternalIndex=False, terraformType='MODULE', enableComposerSupport=False, enableNuGetSupport=False, enableGemsSupport=False, enableNpmSupport=False, enableBowerSupport=False, enableCocoaPodsSupport=False, enableConanSupport=False, enableDebianSupport=False, enablePypiSupport=False, enablePuppetSupport=False, enableDockerSupport=True, forceNugetAuthentication=False, enableVagrantSupport=False, enableGitLfsSupport=False, enableDistRepoSupport=False)



## Checklist:

- [x] My PR is ready for prime time! Otherwise use the ["Draft PR" feature](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)
- [x] All commits have a correct title
- [ ] Readme has been updated
- [x] Quality tests are green (see Codacy)
- [x] Automated tests are green (see pipeline)
dakky commented 3 months ago

Sorry for the delay. Yes, they are missing in the documentation. I opened an issue on their issue tracker: https://jfrog.atlassian.net/browse/RTFACT-30520

Hope they'll fix it soon (although they are not the fastest when resolving these public issues :( )

anancarv commented 3 months ago

Sorry for the delay. Yes, they are missing in the documentation. I opened an issue on their issue tracker: https://jfrog.atlassian.net/browse/RTFACT-30520

Hope they'll fix it soon (although they are not the fastest when resolving these public issues :( )

I can see that they've fixed it. Approving