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

Bpmilestone4 #16

Open
wants to merge 3 commits into
base: feature/multipleSources
Choose a base branch
from

Conversation

akhi1616
Copy link
Contributor

PR raised

  1. Naming convention of tar.gz and .tar files need to correct. Query put-up in box for the same.

@@ -384,7 +386,7 @@ func (e *exportPullOptions) IlmtPullBase(s *datactlapi.Source, ctx context.Conte
return p
})

return productCount, productUsageResponseStr, nil
return productCount, EMPTY, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a need to keep 3 return values here when we are only using only the error object/response in the caller.

Comment on lines +135 to +144
response := i.ilmt.FetchUsageData(ctx, dateRangeOptions, selectedDate)
check(err)

responseFile := fmt.Sprintf(RESPONSEFILE, archFileTempDir, selDate)
manifestFile := fmt.Sprintf(MANIFESTFILE, archFileTempDir)
manifestFileContent := MANIFESTFILECONTENT
err = ioutil.WriteFile(responseFile, response, 0644)
check(err)
err = ioutil.WriteFile(manifestFile, []byte(manifestFileContent), 0644)
check(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling just check(err) [here, and in many other places] is just catching err and panicking. May be we should also log appropriate error messages for each failing scenario?

log.Fatal(err.Error())
return -1, EMPTY, err
}
func (ilmtC *ilmtClient) FetchUsageData(ctx context.Context, dateRange DateRange, selectedDate time.Time) []byte {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can further modularize this FetchUsageData code by moving the processing logic (2 big FOR loops) into a separate util function?

@MJSiddu
Copy link
Contributor

MJSiddu commented Aug 3, 2022

Crashing when I try to pull ILMT data:

Screen Shot 2022-08-03 at 12 16 47 PM

@MJSiddu
Copy link
Contributor

MJSiddu commented Aug 4, 2022

Steps:

  1. Ran go build . from /cmd/datactl to create an executable file called datactl in the same folder
  2. Run ILMT pull command - Ran ./datactl export pull all --source-type ilmt --start-date 2022-06-26 --end-date 2022-06-29

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.

2 participants