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

Upgrade to iambic-core 0.3.1 template compatibility #6

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

smoy
Copy link
Contributor

@smoy smoy commented Apr 25, 2023

No description provided.

@smoy smoy self-assigned this Apr 25, 2023
@ghost
Copy link

ghost commented Apr 25, 2023

exception during plan is blocked

 File "/app/iambic/request_handler/git_plan.py", line 26, in plan_git_changes
   changes = await apply_git_changes(config_path, repo_dir)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/request_handler/git_apply.py", line 69, in apply_git_changes
   modified_templates_doubles = create_templates_for_modified_files(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/core/git.py", line 233, in create_templates_for_modified_files
   main_template = template_cls(file_path=git_diff.path, **main_template_dict)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/core/models.py", line 84, in __init__
   super().__init__(*args, **kwargs)
 File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for AwsIamRoleTemplate
Properties -> PermissionsBoundary -> permissions_boundary_arn
 string does not match regex "(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$" (type=value_error.str.regex; pattern=(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$)
Properties -> PermissionsBoundary
 value is not a valid list (type=type_error.list)
Properties -> ManagedPolicies -> 1 -> PolicyArn
 string does not match regex "(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$" (type=value_error.str.regex; pattern=(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/app/iambic/plugins/v0_1_0/github/github.py", line 507, in handle_iambic_git_plan
   template_changes = run_git_plan(proposed_changes_path, repo_dir)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/main.py", line 344, in run_git_plan
   template_changes = asyncio.run(plan_git_changes(config_path, repo_dir))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Python-3.11.1/Lib/asyncio/runners.py", line 190, in run
   return runner.run(main)
          ^^^^^^^^^^^^^^^^
 File "/Python-3.11.1/Lib/asyncio/runners.py", line 118, in run
   return self._loop.run_until_complete(task)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Python-3.11.1/Lib/asyncio/base_events.py", line 653, in run_until_complete
   return future.result()
          ^^^^^^^^^^^^^^^
 File "/app/iambic/request_handler/git_plan.py", line 29, in plan_git_changes
   return changes
          ^^^^^^^
UnboundLocalError: cannot access local variable 'changes' where it is not associated with a value

@ghost
Copy link

ghost commented Apr 25, 2023

exception during plan is blocked

 File "/app/iambic/request_handler/git_plan.py", line 26, in plan_git_changes
   changes = await apply_git_changes(config_path, repo_dir)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/request_handler/git_apply.py", line 69, in apply_git_changes
   modified_templates_doubles = create_templates_for_modified_files(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/core/git.py", line 233, in create_templates_for_modified_files
   main_template = template_cls(file_path=git_diff.path, **main_template_dict)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/core/models.py", line 84, in __init__
   super().__init__(*args, **kwargs)
 File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for AwsIamRoleTemplate
Properties -> PermissionsBoundary -> permissions_boundary_arn
 string does not match regex "(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$" (type=value_error.str.regex; pattern=(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$)
Properties -> PermissionsBoundary
 value is not a valid list (type=type_error.list)
Properties -> ManagedPolicies -> 1 -> PolicyArn
 string does not match regex "(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$" (type=value_error.str.regex; pattern=(^arn:([^:]*):([^:]*):([^:]*):(|\*|[\d]{12}|cloudfront|aws|{{var.account_id}}):(.+)$)|^\*$)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/app/iambic/plugins/v0_1_0/github/github.py", line 507, in handle_iambic_git_plan
   template_changes = run_git_plan(proposed_changes_path, repo_dir)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/app/iambic/main.py", line 344, in run_git_plan
   template_changes = asyncio.run(plan_git_changes(config_path, repo_dir))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Python-3.11.1/Lib/asyncio/runners.py", line 190, in run
   return runner.run(main)
          ^^^^^^^^^^^^^^^^
 File "/Python-3.11.1/Lib/asyncio/runners.py", line 118, in run
   return self._loop.run_until_complete(task)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Python-3.11.1/Lib/asyncio/base_events.py", line 653, in run_until_complete
   return future.result()
          ^^^^^^^^^^^^^^^
 File "/app/iambic/request_handler/git_plan.py", line 29, in plan_git_changes
   return changes
          ^^^^^^^
UnboundLocalError: cannot access local variable 'changes' where it is not associated with a value

@smoy
Copy link
Contributor Author

smoy commented Apr 25, 2023

I need to override this incompatibility issue. At the moment, blocked to noqdev/iambic#360, so we need to get the git history compatible with the latest iambic first.

how I verify?
I can run iambic import locally

@mdaue2
Copy link

mdaue2 commented Apr 25, 2023

I need to override this incompatibility issue. At the moment, blocked to noqdev/iambic#360, so we need to get the git history compatible with the latest iambic first.

how I verify? I can run iambic import locally

Decided to just fix the template directory by merging to main.

@smoy smoy merged commit 10b8716 into main Apr 25, 2023
@smoy smoy deleted the fix/upgrade-templates-0-3-1 branch April 25, 2023 21:11
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