Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Sync android apps from json file #1191

Merged
merged 23 commits into from
Dec 2, 2020
Merged

Conversation

whaught
Copy link
Contributor

@whaught whaught commented Nov 24, 2020

Issue #1092

Proposed Changes

  • Unmarshal the json file for the list of android apps
  • Structs to hold the result
  • Look up/cache realms
  • Look up/cache mobile-apps per realm
  • If the file app doesn't exist, create it.

Release Note

New endpoint to sync android apps to realms from a configurable .json file URL.
This will be hooked up to a cron job in the future.

@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Nov 24, 2020
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/response.go Outdated Show resolved Hide resolved
@whaught whaught changed the title Unmarshall response from json file Sync android apps from json file Nov 25, 2020
pkg/config/appsync_server_config.go Show resolved Hide resolved
pkg/config/appsync_server_config.go Outdated Show resolved Hide resolved
pkg/config/appsync_server_config.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
internal/project/random.go Outdated Show resolved Hide resolved
pkg/config/appsync_server_config.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
return merr
}

func generateAppName(app clients.App) string {
Copy link
Member

Choose a reason for hiding this comment

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

To avoid the extra check, should we always append a random ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started that way. I kind of think the random is ugly (and collisions are unlikely in the real-world) so I figured to optimize for nice names.

pkg/controller/appsync/appsync_test.go Show resolved Hide resolved
pkg/controller/appsync/appsync_test.go Outdated Show resolved Hide resolved
pkg/controller/appsync/appsync_test.go Outdated Show resolved Hide resolved
whaught and others added 8 commits December 2, 2020 09:01
Co-authored-by: Seth Vargo <seth@sethvargo.com>
Co-authored-by: Seth Vargo <seth@sethvargo.com>
Co-authored-by: Seth Vargo <seth@sethvargo.com>
Co-authored-by: Seth Vargo <seth@sethvargo.com>
Copy link
Member

@sethvargo sethvargo left a comment

Choose a reason for hiding this comment

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

/lgtm

/hold

one nit

pkg/controller/appsync/appsync.go Outdated Show resolved Hide resolved
@sethvargo
Copy link
Member

/lgtm

Copy link
Contributor

@flagxor flagxor left a comment

Choose a reason for hiding this comment

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

lgtm

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flagxor, sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@whaught
Copy link
Contributor Author

whaught commented Dec 2, 2020

/hold cancel

@google-oss-robot google-oss-robot merged commit 0596024 into google:main Dec 2, 2020
@whaught whaught deleted the appsync branch December 2, 2020 20:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants