Skip to content

Commit

Permalink
Merge pull request #44 from Noahnc/fix/changelog_with_tile_constraint
Browse files Browse the repository at this point in the history
Fix/changelog_with_tile_constraint
  • Loading branch information
Noahnc authored Dec 9, 2023
2 parents 2500bf3 + b104b91 commit bbc6171
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions infrapatch/action/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def get_pr_body(provider_handler: ProviderHandler) -> str:
body += markdown_tables[provider_name].dumps()
body += "\n"
if provider_name in release_notes:
if len(release_notes[provider_name]) == 0:
log.debug(f"No release notes found for provider '{provider_name}'.")
continue
log.debug(f"Adding release notes for provider '{provider_name}' to pull request body.")
body += "## Changelog\n"
for release_note in release_notes[provider_name]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_resource_release_notes(self, resource: VersionedTerraformResource) -> Un
return None
try:
repo = self._github.get_repo(resource.github_repo)
release_notes = repo.get_release(f"v{resource.newest_version}").body
release_notes = repo.get_release(f"v{resource.newest_version_base}").body
except Exception as e:
log.warning(f"Could not get release notes from repo '{resource.github_repo}' for version '{resource.newest_version}': {e}")
return None
Expand Down
2 changes: 1 addition & 1 deletion infrapatch/core/utils/terraform/registry_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_source(self, resource: VersionedTerraformResource) -> Union[str, None]:
return cache.source

base_endpoint, registry_base_domain = self._compose_base_url(resource)
version_info_endpoint = f"{base_endpoint}/{resource.newest_version}"
version_info_endpoint = f"{base_endpoint}/{resource.newest_version_base}"
try:
response = self._send_request(version_info_endpoint, registry_base_domain)
except TerraformRegistryException as e:
Expand Down
6 changes: 5 additions & 1 deletion tf_test_files/project2/meta.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azuread"
source = "hashicorp/azurerm"
version = "0.0.1"
}
azuread = {
source = "hashicorp/azuread"
version = "~>1.1.0"
}
}
}

0 comments on commit bbc6171

Please sign in to comment.