-
Notifications
You must be signed in to change notification settings - Fork 670
feat(customize): add account handling for imported issues #8401
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
Conversation
- Create or update accounts for creator and assignee - Link accounts to issues in the database - Add account data to issues_output.csv - Verify account data with snapshot_tables/accounts.csv #8400
| var err errors.Error | ||
| var id string | ||
| if record["id"] == nil { | ||
| idValue, ok := record["id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen some duplicated codes like:
idValue, ok := record["id"]
if !ok || idValue == nil {
return errors.Default.New("record without id")
}
id, ok := idValue.(string)
if !ok || id == "" {
return errors.Default.New("invalid or empty id")
}
I think we can simplify a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. The relevant logic has been extracted into a getStringField function, and a test case has been added for it.
| return "", nil // Return empty ID if name is empty, no error needed here. | ||
| } | ||
| now := time.Now() | ||
| accountId := fmt.Sprintf("csv:CsvAccount:0:%s", accountName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 0 in csv:CsvAccount:0:%s correct? I am not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSV is not a real data source within the system; there are no plugins or connections specifically for CSV. This ID is a mock, designed to match the format of other entities, so all data obtained through the API (which is in CSV format) shares this single "connection".
…d handling - Add getStringField function to extract and validate string fields from records - Use getStringField to replace repetitive code in issueHandlerFactory - Add unit tests for getStringField to ensure its correctness #8400
#8400
pr-type/bug-fix,pr-type/feature-development, etc.Summary
What does this PR do?
Does this close any open issues?
Closes xx
Screenshots
Include any relevant screenshots here.
Other Information
Any other information that is important to this PR.