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

removing duplicate module validation caught by cfn-lint #750

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PatMyron
Copy link
Contributor

@PatMyron PatMyron commented May 3, 2021

#634
#644

left module-specific validation like restrictions on exports, macros/transforms, and nested stacks

def __validate_resources(self, raw_fragments):
if "Resources" not in raw_fragments:
Copy link
Contributor

Choose a reason for hiding this comment

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

Validations like this have been added to avoid parsing errors that are impossible to understand by the user. I'm not sure if we're regressing on the user experience here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cfn-lint will throw E1001 Missing top level template section Resources for this validation

Copy link
Contributor

Choose a reason for hiding this comment

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

@PatMyron For all the validations that you removed in this PR can you show us what it looks like right now and what it will look like after? Wanna make sure that the error messages in cfn-lint are on par with the ones in the CLI

Copy link
Contributor

Choose a reason for hiding this comment

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

My concern is that cfn lint is executed after these validations and that some validations require others. For example this line checks that the Resources section exists, but there are other validations further down which assume that this validation has already happened. So, I suspect that in this case the user would only see some kind of null pointer exception instead of a useful message. (which is why Maria asked for these cases to be tested)

@PatMyron PatMyron force-pushed the modules branch 3 times, most recently from fbf65a6 to 8093414 Compare May 3, 2021 19:44
@miparnisari
Copy link
Contributor

The fragments folder cannot have more than 1 json or yaml file. Can we add this validation? Otherwise it'll fail at runtime during registration

@MalikAtalla-AWS
Copy link
Contributor

MalikAtalla-AWS commented May 5, 2021

That validation should already exist, Maria. I had added that a while ago.

@miparnisari
Copy link
Contributor

miparnisari commented May 6, 2021

That validation should already exist, Maria. I had added that a while ago.

I was able to submit a module today with two files inside fragments: s3.json and blabla.json.old

I had an old version of the CFN CLI

@mircealam
Copy link
Member

@MalikAtalla-AWS @PatMyron does this change still apply and/or what rework is needed here?

@MalikAtalla-AWS
Copy link
Contributor

My comments are addressed, but the build is failing @mircealam

@mircealam mircealam closed this Oct 9, 2023
@mircealam mircealam reopened this Oct 9, 2023
@PatMyron
Copy link
Contributor Author

My comments are addressed, but the build is failing @mircealam

looks like that test was removed in #1028 already

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.

5 participants