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

feat: add DDEV Fig spec generation #4216

Merged
merged 3 commits into from
Sep 25, 2022
Merged

Conversation

khalwat
Copy link
Collaborator

@khalwat khalwat commented Sep 19, 2022

The Problem/Issue/Bug:

This FR automatically generates a Fig spec for Fig, as part of the ddev_gen_autocompletes command, so it does so as part of the automated build process.

This brings full terminal autocomplete for all Fig commands, with complete inline documentation. The resulting file does nothing on its own, but then you can either push the spec to the autocomplete repo or push it to Fig's cloud.

Then it will be available to everyone who uses Fig.

How this PR Solves The Problem:

This PR allows us to easily submit a Fig autocomplete for DDEV, so that everyone who uses Fig will benefit.

Manual Testing Instructions:

Run:

make completions
cat .gotmp/bin/completions/ddev_fig_spec.ts

To see the resulting generated Fig Spec Typescript file.

Automated Testing Overview:

No tests are introduced, as I saw no testing being done on the bash/zsh/etc autocomplete files, and the resulting file is just a generated file that does nothing until submitted as mentioned above.

Related Issue Link(s):

It uses an officially provided module for Cobra to do the work.

Release/Deployment notes:

Nothing needs to be changed for release/deployment.

@khalwat khalwat changed the title feat: add ddev fig spec generation feat: add DDEV fig spec generation Sep 19, 2022
@github-actions
Copy link

@khalwat khalwat changed the title feat: add DDEV fig spec generation feat: add DDEV Fig spec generation Sep 19, 2022
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Congrats on the tests being fine!

These will need to be installed, normally, right? So:

  • Can brew install them? They should be added there.
  • Can apt install fig completions? They should be added there.
  • Docs should explain how to manually install.
  • If it can be pushed to fig's cloud, maybe that should be done by the master build github action?

@khalwat
Copy link
Collaborator Author

khalwat commented Sep 21, 2022

Manually added a PR to Fig to add the command: withfig/autocomplete#1513

@khalwat
Copy link
Collaborator Author

khalwat commented Sep 21, 2022

@rfay no, there is nothing to install. The generated file has been PR'd to become part of the Fig repo, so people who use Fig don't have to do anything.

The reason for this PR is because it integrates with ddev_gen_autocompletes the same way the other completions do, so it needs to be part of the DDEV project to function.

If you want the spec to be auto-updated via CI, you can optionally follow the steps here (I don't have the access/creds to do any of this):

https://fig.io/docs/guides/integrating/push-to-autocomplete-action

...which will re-generate the spec for every version of DDEV, and push it to their repo

@khalwat
Copy link
Collaborator Author

khalwat commented Sep 22, 2022

If there's anything else you need me to do here, just let me know @rfay

@rfay
Copy link
Member

rfay commented Sep 25, 2022

I'll go ahead and bring this in. I would certainly like a PR to auto-push to fig. I'm happy to help you figure that out.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

Thanks!

@rfay rfay merged commit 38f7473 into ddev:master Sep 25, 2022
@rfay
Copy link
Member

rfay commented Oct 10, 2022

@khalwat could you please add to the DDEV developer docs step-by-step on how to generate and submit the fig completions? Thanks! It's a nice tool.

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.

None yet

2 participants