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

GetPlatform called via gRPC does not force to update the indices #1529

Closed
4ntoine opened this issue Oct 21, 2021 · 3 comments · Fixed by #2119
Closed

GetPlatform called via gRPC does not force to update the indices #1529

4ntoine opened this issue Oct 21, 2021 · 3 comments · Fixed by #2119
Assignees
Labels
topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: enhancement Proposed improvement

Comments

@4ntoine
Copy link
Contributor

4ntoine commented Oct 21, 2021

Bug Report

Current behavior

Call GetPlatform with all=true on a clean system does not force to update the indices.

Expected behavior

It forces the update (exactly as it's done if calling via command-line core list --all

Environment

  • CLI version (output of arduino-cli version): 0.19.2 commit 6a6f50ae
  • OS and platform: Alpine linux

Additional context

Looking into the source code i can't see any difference except missing instance.CreateAndInit() call.

In my case i do call create + init requests before requesting the subscriptions.

PS. Using custom data path in config file (not sure if it makes a difference)

@4ntoine
Copy link
Contributor Author

4ntoine commented Oct 21, 2021

During the init i do get an error about missing index (but just ignore it):

error: {
  code: 9
  message: Loading index file: loading json index file /root/project/data/package_index.json: open /root/project/data/package_index.json: no such file or directory
}

@4ntoine
Copy link
Contributor Author

4ntoine commented Oct 21, 2021

Clean data dir to reproduce

@per1234 per1234 added topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project labels Nov 19, 2021
@umbynos umbynos assigned cmaglie and unassigned silvanocerza Feb 2, 2023
@umbynos
Copy link
Contributor

umbynos commented Feb 2, 2023

GetPlatform does not update the index by design. We won't change that.
By the way downloading the indexes during the first start is something that we should implement.
I'm keeping this issue open to track this task.

@umbynos umbynos added this to the Arduino CLI 1.0 milestone Feb 2, 2023
@umbynos umbynos added type: enhancement Proposed improvement and removed type: imperfection Perceived defect in any part of project labels Feb 2, 2023
@umbynos umbynos assigned MatteoPologruto and unassigned cmaglie Mar 6, 2023
@cmaglie cmaglie assigned cmaglie and unassigned MatteoPologruto Mar 23, 2023
cmaglie added a commit to cmaglie/arduino-cli that referenced this issue Mar 23, 2023
cmaglie added a commit to cmaglie/arduino-cli that referenced this issue Apr 14, 2023
cmaglie added a commit to cmaglie/arduino-cli that referenced this issue May 12, 2023
cmaglie added a commit to cmaglie/arduino-cli that referenced this issue Jun 16, 2023
cmaglie added a commit that referenced this issue Jun 16, 2023
* Created core.PlatformList implementaion follow gRPC naming

Previously it was named GetPlatforms with a different return type than
the one defined in gRPC API .proto files.

* Added test for #1529

* Perform first-update automatically in gRPC Init

* Made cli.instance.Create function private

* Extract function to compute index file name

* Auto-download 3rd party indexes as part of the Init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants