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

Sc 14489: contact migration #1012

Merged
merged 7 commits into from
May 15, 2023
Merged

Sc 14489: contact migration #1012

merged 7 commits into from
May 15, 2023

Conversation

DanielSollis
Copy link
Contributor

Scope of changes

Adds a new gdsutil command to migrate vasp contacts to the model contacts namespace.

Type of change

  • bug fix
  • new feature
  • documentation
  • other (describe)

Acceptance criteria

Describe how reviewers can test this change to be sure that it works correctly. Add a checklist if possible

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.

@DanielSollis DanielSollis changed the title Sc 14489 Sc 14489: contact migration May 12, 2023
Copy link
Collaborator

@pdeziel pdeziel left a comment

Choose a reason for hiding this comment

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

Makes sense to me! The plan is to just keep this in the branch until the migration is done right?

}
} else {
modelContact.Vasps = append(modelContact.Vasps, vasp.CommonName)
modelContact.EmailLog = append(modelContact.EmailLog, vaspContactExtra.EmailLog...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this work if vaspContactExtra.EmailLog is nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, I checked and it doesn't, fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for checking!

if c.Bool("dryrun") {
fmt.Println("existing vasp contacts:")
for _, contact := range vaspContacts {
fmt.Print(contact)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might want to newline separate these or something or just print out the emails space separated because this is probably going to be messy when things get printed out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good Idea!

for iter.Next() {
vaspContact, _ := iter.Value()
vaspContacts = append(vaspContacts, vaspContact)
modelContact, AlreadyExists := modelContacts[vaspContact.Email]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may need to make sure the email is normalized before putting it in the map, although if it's coming from the VASP hopefully it will already be.

@DanielSollis
Copy link
Contributor Author

There is a story for Ben in the email verification epic to do the migration using this command. That will need to happen by Friday so we should probably just go ahead and merge this.

Copy link
Collaborator

@pdeziel pdeziel left a comment

Choose a reason for hiding this comment

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

:shipit:

@DanielSollis DanielSollis merged commit 51fc721 into main May 15, 2023
@DanielSollis DanielSollis deleted the sc-14489 branch May 15, 2023 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants