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

Added terraform backend and helmoci package types #161

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

dakky
Copy link
Contributor

@dakky dakky commented May 2, 2024

Description

This PR added 2 repotypes to the library:

  • helmoci
  • terraformbackend

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • integration tests:
repo = LocalRepository(key="tf-be", packageType="terraformbackend")
newrepo = art.repositories.create_repo(repo)
repo = art.repositories.get_repo("tf-be")
pprint(repo)
art.repositories.delete("tf-be")

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:

  • My PR is ready for prime time! Otherwise use the "Draft PR" feature
  • All commits have a correct title
  • Readme has been updated
  • Quality tests are green (see Codacy)
  • Automated tests are green (see pipeline)

@@ -40,6 +41,7 @@ class PackageTypeEnum(str, Enum):
rpm = "rpm"
sbt = "sbt"
terraform = "terraform"
terraformbackend = "terraformbackend"
Copy link
Owner

Choose a reason for hiding this comment

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

I cannot see terraformbackend form the Public API. Can you please point me to where it is documented ?

@@ -179,6 +181,7 @@ class LocalRepository(BaseRepositoryModel):
secondaryKeyPairRef: Optional[str] = None
priorityResolution: bool = False
cargoInternalIndex: bool = False
terraformType: Literal["MODULE", "PROVIDER"] = "MODULE"
Copy link
Owner

Choose a reason for hiding this comment

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

Same, cannot see it on the public API

@dakky
Copy link
Contributor Author

dakky commented May 13, 2024

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
Copy link
Owner

anancarv commented Jun 4, 2024

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

@anancarv anancarv merged commit 20b2726 into anancarv:master Jun 4, 2024
2 of 6 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.

None yet

2 participants