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

Error validation needs improvement for create-lookup-table #1223

Open
bendemora opened this issue Aug 23, 2023 · 3 comments
Open

Error validation needs improvement for create-lookup-table #1223

bendemora opened this issue Aug 23, 2023 · 3 comments

Comments

@bendemora
Copy link

Preflight Checklist

  • [ X ] I have read the Contributing Guidelines for this project.
  • [ X ] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Operating System:
    • macOS 13.4.1(c)
  • Browser:
    • N/A

Expected Behavior

When running a correctly formatted AWS service list CSV input file through the create-lookup-table function, the function should bypass/ignore any AWS service entries or row records that it cannot recognise or parse. The tool should complete correctly and provide an output lookup file addressing all AWS services that it can recognise.

Actual Behavior

Tool fails with an error message complaining about bad data (but doesn't show WHAT data was bad) and fails without creating any output or action log.

To Reproduce

1: Install the app according to the instructions on https://www.cloudcarbonfootprint.org/docs/create-app using:
npx @cloud-carbon-footprint/create-app@latest

2: copy a fairly large set of correctly formatted AWS data as per the Athena query generation process from https://www.cloudcarbonfootprint.org/docs/creating-a-lookup-table into the ./packages/cli folder

3: from within the ./packages/cli folder, run the command as per the page linked above:
yarn create-lookup-table --awsInput <datafile.csv>

if ANY of the service lines or entries are not recognised, tool will fail as described above. Good example is if there are any ECS or RDS rows in the file.

@bendemora
Copy link
Author

I'm going to review the code to see whether error handling can be added to this without too much effort - and potentially generate a branch and PR for merging.

@4upz
Copy link
Member

4upz commented Aug 24, 2023

@bendemora Thanks for opening this issue! I believe this fix would make sense, as long as the new error handling also logs the rows or a list of the service/region that it had trouble parsing.

A good place to start may be the following function in the AWS package's CostAndUsageReports.ts file:

There may be some error handling in the function itself or further down the stack that can be adjusted for this. A similar fix will also need to be done for the other similar cloud provider functions.

@bendemora
Copy link
Author

Forked and submitted PR: #1226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🙋🏼 Being Contributed
Development

No branches or pull requests

2 participants