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

[spaceship] allow to specify fetched fields #21528

Merged
merged 1 commit into from Oct 6, 2023

Conversation

nekrich
Copy link
Contributor

@nekrich nekrich commented Sep 22, 2023

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Currently, I'm working on match optimization. I've figured out that match fetches certificates with all fields, including enormous certificateContent and csrContent, and match doesn't need them.
A reduced amount of fetched fields leads to faster response generation and faster transmission to the client.

Description

Changes are really small, I just added a fields parameter to the api_client, certificate, device, bundle id and profile.

Testing Steps

Spaceship::ConnectAPI::Device.all(fields: 'platform,status')

@Chupaka
Copy link

Chupaka commented Sep 28, 2023

Hey @nekrich, sorry for hijacking your PR, did you look at 'limit' parameter for API requests? Looks like it defaults to 20 responses per page, and max limit is 200 (? I believe I saw it on some Apple website...), but I can't find a way to set it manually... That would speed up things for accounts with many items 🤞

@nekrich
Copy link
Contributor Author

nekrich commented Sep 29, 2023

@Chupaka thanks for suggestion, I'll look into it too. Reducing requests count is awesome.

But even with bigger limit, there is an issue with certificates which include excessive data match and sigh don't really need. And it spreads to the profiles when we fetch them with certificates. Plus I don't think (didn't test it in practice) that certificateContent and csrContent will have a good compression ratio while transferring.

@getaaron
Copy link
Collaborator

getaaron commented Oct 6, 2023

Thanks for the PR, @nekrich. Looks great!

@getaaron getaaron merged commit a615e60 into fastlane:master Oct 6, 2023
10 checks passed
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

3 participants