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

Add buf migrate command #2669

Merged
merged 41 commits into from
Dec 27, 2023
Merged

Add buf migrate command #2669

merged 41 commits into from
Dec 27, 2023

Conversation

oliversun9
Copy link
Contributor

@oliversun9 oliversun9 commented Dec 15, 2023

This PR makes update to the migrate command:

  • moves it from buf beta migrate to buf migrate
  • Update flags to take --module and --workspace instead of paths to those files.
  • The destination for the buf.yaml and buf.lock is ., unless --workspace is specified but --module is not specified, in which case the destination is the directory for that buf.yaml.
    • If the user runs buf migrate --workspace foo/bar, then the new buf.yaml will be written at foo/bar/buf.yaml.
    • Otherwise, ./buf.yaml will be written.
  • Only allows one workspace to be specified. (This isn't new in this PR, but want to highlight this).
  • Add flag --template, allowing multiple paths to buf.gen.yamls.
  • Fixes the bug where the command crashes when only one directory without a buf.yaml is specified.
  • Update lint/breaking rule translation to produce equivalent lists of rules with minimal diff.

Note: with the recent change on reading a lock file without digest. Right now buf migrate fails with Failure: unimplemented if there is a buf.lock to write. It shouldn't fail once commit service has been implemented.

"%s is a v1 generation template with a top-level 'types' section including %s. In a v2 generation template, 'types' can"+
" only exist within an input in the 'inputs' section. Since the migration command does not have information"+
" on inputs, the migrated generation will not have an 'inputs' section. To add these types in the migrated file, you can"+
" first add an input to 'inputs' and then add these types to the input.",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think this make sense? @doriable

@bufdev bufdev merged commit 4991590 into bufmod Dec 27, 2023
6 of 9 checks passed
@bufdev bufdev deleted the osun/migrate branch December 27, 2023 04:03
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