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

Client update command gains support for specifying lock file path #470

Closed
thompson-tomo opened this issue Nov 13, 2024 · 3 comments
Closed
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@thompson-tomo
Copy link
Contributor

I would for my api client libraries to be auto generated at build time to ensure the client is fully up to date with the latest specification. With the key item being auto-generated code should not be checked in so that it doesn't implement code coverage etc.

There is 2 ways to achieves this however only 1 of which works hence this issue:

Full Generation each time [Works]

  • Add the generation command (as per below) to the project pre-build event
kiota generate -l CSharp -c <<ClientName>> -n <<NameSpace>> -d <<yamlFilePath>> -o <<outputFolder>> --co
  • GitIgnore the output folder
  • This gets complex and hard to mantain when filters each are being added and the command can be come really long

Reuse previous definition

-Run the generation command as per below

kiota generate -l CSharp -c <<ClientName>> -n <<NameSpace>> -d <<yamlFilePath>> -o <<outputFolder>> --co
  • Move the lock file out of the output folder into a higher folder
  • GitIgnore the output folder
  • Add the generation command (as per below) to the project pre-build event
kiota update -o <<outputFolder>> --co
  • Observe generation failed due to no lock file foud,

As such it would be helpful if:

  • the generate command allows us to specify a folder to put the lock file in
  • the update command allows us to specigy which folder it should look for the lock file in.
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Nov 13, 2024
@baywet
Copy link
Member

baywet commented Nov 14, 2024

Hi @thompson-tomo
Thank you for using kiota and for reaching out.

Over the past year we've been working to revamp the lock and cli experience.

Set the KIOTA_CONFIG_PREVIEW to true ($env:KIOTA_CONFIG_PREVIEW = $true for PowerShell) and you'll notice a couple of changes:

  • workspace configuration (replaces the lock) placed in the Current Working Directory
  • workspace configuration aggregates all the clients
  • new commands to add/generate clients

Give it a try and let us know what you think!

If you want to keep using the lock for your scenario, there's a simple solution, exclude the client directory but not the lock. i.e.

/foo/bar/baz
!/foo/bar/baz/kiota-lock.json

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question labels Nov 14, 2024
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Nov 14, 2024
@thompson-tomo
Copy link
Contributor Author

Thanks @baywet will look into using the preview environment & let u know how I get on.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Nov 15, 2024
@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Nov 15, 2024

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@github-project-automation github-project-automation bot moved this from Waits for author 🔁 to Done ✔️ in Kiota Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
Archived in project
Development

No branches or pull requests

2 participants