Running into an interesting `!include` error this ...
# atmos-dev
m
Running into an interesting
!include
error this morning after upgrading to
1.191.0
. We have a catalog item that declares:
Copy code
components:
  terraform:
    waf:
      metadata:
        inherits:
          - waf/defaults
      settings:
        ips:
          org:
            inet_gws: !include "stacks/objects/ips-org-gateways.yaml"
          datadog:
            synthetics: !include "stacks/objects/ips-datadog-synthetics.yaml"
      vars:
        name: waf
        description: WAF
        ip_set_reference_statement_rules:
        - name: "allow-org"
          action: "allow"
          priority: 26
          statement:
            ip_set:
              ip_address_version: "IPV4"
              addresses:
                !template '{{ toJson (concat
                  .settings.ips.org.inet_gws.addresses
                  .settings.ips.datadog.synthetics.addresses
                ) }}'
In
stacks/objects/ips-datadog-synthetics.yaml
, the address list looks like:
Copy code
# Datadog Synthetics IP Ranges
addresses:
  - "3.1.36.99/32"
  - "3.1.219.207/32"
  - "3.18.172.189/32"
  - "3.18.188.104/32"
All stacks validate and plan as intended, but the
describe affected
command is failing in our CI:
Copy code
Run base_cmd="atmos describe affected --include-settings=false --file affected-stacks.json --repo-path \"$GITHUB_WORKSPACE/base-ref\""

# Error                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
invalid stack manifest: failed to download file 'stacks/objects/ips-org-gateways': relative paths require a module with a pwd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
 File being processed: catalog/waf/waf.yaml                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 Import chain:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
   → orgs/XXXX/XXX/XXX/us-east-1.yaml                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
     → catalog/waf/waf.yaml                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 stack manifest 'catalog/waf/waf.yaml'
Maybe I'm missing something?
e
Interesting!
So on the plus side, looks like the improved error handling is working nicely
Now for the error itself... not sure. Let me see if I can get a reproduce case.
Could you throw that into a GitHub Issue? that'll inform the work.
m
I've been loving the new errors! Makes it so much easier to track down stack files. I even incorporated it into Windsurf for testing
Of course, opening one now
e
plus the error wrapping is paying dividends
1000 1
m
Feel free to update the title if you have a better name! https://github.com/cloudposse/atmos/issues/1520
e
If the build passes, we'll cut a preview release for you to verify
m
Taking a look now
e
The feature release is building. Also Code Rabbit had some gotchas.
m
I'm trying to find a good representative test, but this completes successfully now!
Copy code
√ . [infra] (HOST) workspace ⨠ atmos describe affected --include-settings=false --file affected-stacks.json --repo-path .
e
ok, that's promising.
our
setup-atmos
action supports installing these feature releases
So if you want to test it in the workflow, that's possible
m
I’ll have to take a look and see how we can do that. Looks good so far, but I’ll do more validation tomorrow
👍 1