Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
55c5034
Test list_robot_accounts
esron Jul 16, 2025
41ab5ff
Test list_robot_accounts raises for ther status
esron Jul 17, 2025
679f209
Test create_robot_account
esron Jul 17, 2025
9325d74
Test creat_robot_account raises for other status
esron Jul 17, 2025
e386e46
Test delete robot_account
esron Jul 17, 2025
5d3ede3
Test delete robot account raises for other status
esron Jul 17, 2025
684d9fe
Format
esron Jul 17, 2025
7c0d4a2
Add tests for repo permissions methods
esron Jul 31, 2025
edc1acc
Add robot-accounts query
esron Jul 31, 2025
c6bab81
Add robot accounts integration file
esron Jul 31, 2025
c696f28
Add robot accounts integration tests
esron Jul 31, 2025
8808c32
Add quay robot accounts to cli
esron Jul 31, 2025
5421d01
Fix typing for quay_robot_accounts
esron Aug 21, 2025
20fcbdd
Fix typting for quay_api tests
esron Aug 21, 2025
fd2e204
Fix typing for quay_robot_accounts tests
esron Aug 21, 2025
8da2f4c
Remove test for message checking
esron Aug 25, 2025
b79e278
Use robot short name to get robot account details
esron Aug 26, 2025
e3b5d5d
make gql-introspection
esron Oct 8, 2025
a54e19b
remove duplicate get response
esron Dec 18, 2025
b29b1e3
Use create autospect
esron Dec 18, 2025
632ea56
Add RobotAccountDetails type
esron Dec 18, 2025
1e7f726
Adapt quay api tests to be session based
esron Jan 16, 2026
1b0f6df
fix quay_mirror account that depend on QuayApiStore
esron Jan 16, 2026
4409d5d
Update test_quay_robot_accounts to use QuayApiStore
esron Jan 16, 2026
50c8d33
Adds robot account methods based on new Api class
esron Jan 16, 2026
a9c77b4
Fix get_quay_api_store return type
esron Jan 16, 2026
ea1aae0
Fix integration to use QuayApiStore
esron Jan 16, 2026
c35f217
Fix: change logging messages to debug
esron Jan 16, 2026
06a3753
Fix: remove unwanted expection handling
esron Jan 16, 2026
e4f0d94
Fix: removes unecessarie type definitions
esron Jan 19, 2026
0c21c94
Fix: use enum on RobotAccountActions
esron Jan 19, 2026
457ed70
Fix: use mock_quay_api as a fixture to improve tests
esron Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reconcile/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,14 @@ def quay_membership(ctx: click.Context) -> None:
run_integration(reconcile.quay_membership, ctx)


@integration.command(short_help="Manages robot accounts in Quay organizations.")
@click.pass_context
def quay_robot_accounts(ctx: click.Context) -> None:
import reconcile.quay_robot_accounts

run_integration(reconcile.quay_robot_accounts, ctx)


@integration.command(short_help="Mirrors external images into GCP Artifact Registry.")
@click.pass_context
@binary(["skopeo"])
Expand Down
3,341 changes: 1,688 additions & 1,653 deletions reconcile/gql_definitions/introspection.json

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# qenerate: plugin=pydantic_v1

query QuayRobotAccounts {
robot_accounts: quay_robots_v1 {
name
description
quay_org {
name
instance {
name
url
}
automationToken {
path
field
version
}
}
teams
repositories {
name
permission
}
}
}
104 changes: 104 additions & 0 deletions reconcile/gql_definitions/quay_robot_accounts/quay_robot_accounts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
"""
Generated by qenerate plugin=pydantic_v1. DO NOT MODIFY MANUALLY!
"""
from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
from datetime import datetime # noqa: F401 # pylint: disable=W0611
from enum import Enum # noqa: F401 # pylint: disable=W0611
from typing import ( # noqa: F401 # pylint: disable=W0611
Any,
Optional,
Union,
)

from pydantic import ( # noqa: F401 # pylint: disable=W0611
BaseModel,
Extra,
Field,
Json,
)


DEFINITION = """
query QuayRobotAccounts {
robot_accounts: quay_robots_v1 {
name
description
quay_org {
name
instance {
name
url
}
automationToken {
path
field
version
}
}
teams
repositories {
name
permission
}
}
}
"""


class ConfiguredBaseModel(BaseModel):
class Config:
smart_union=True
extra=Extra.forbid


class QuayInstanceV1(ConfiguredBaseModel):
name: str = Field(..., alias="name")
url: str = Field(..., alias="url")


class VaultSecretV1(ConfiguredBaseModel):
path: str = Field(..., alias="path")
field: str = Field(..., alias="field")
version: Optional[int] = Field(..., alias="version")


class QuayOrgV1(ConfiguredBaseModel):
name: str = Field(..., alias="name")
instance: QuayInstanceV1 = Field(..., alias="instance")
automation_token: Optional[VaultSecretV1] = Field(..., alias="automationToken")


class QuayRepositoryV1(ConfiguredBaseModel):
name: str = Field(..., alias="name")
permission: str = Field(..., alias="permission")


class QuayRobotV1(ConfiguredBaseModel):
name: str = Field(..., alias="name")
description: Optional[str] = Field(..., alias="description")
quay_org: Optional[QuayOrgV1] = Field(..., alias="quay_org")
teams: Optional[list[str]] = Field(..., alias="teams")
repositories: Optional[list[QuayRepositoryV1]] = Field(..., alias="repositories")


class QuayRobotAccountsQueryData(ConfiguredBaseModel):
robot_accounts: Optional[list[QuayRobotV1]] = Field(..., alias="robot_accounts")


def query(query_func: Callable, **kwargs: Any) -> QuayRobotAccountsQueryData:
"""
This is a convenience function which queries and parses the data into
concrete types. It should be compatible with most GQL clients.
You do not have to use it to consume the generated data classes.
Alternatively, you can also mime and alternate the behavior
of this function in the caller.

Parameters:
query_func (Callable): Function which queries your GQL Server
kwargs: optional arguments that will be passed to the query function

Returns:
QuayRobotAccountsQueryData: queried data parsed into generated classes
"""
raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
return QuayRobotAccountsQueryData(**raw_data)
4 changes: 2 additions & 2 deletions reconcile/quay_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
self.cleanup()


def get_quay_api_store() -> dict[OrgKey, OrgInfo]:
def get_quay_api_store() -> QuayApiStore:
"""
Returns a dictionary with a key for each Quay organization
managed in app-interface.
"""
quay_orgs = queries.get_quay_orgs()
settings = queries.get_app_interface_settings()
secret_reader = SecretReader(settings=settings)
store = {}
store = QuayApiStore()
for org_data in quay_orgs:
instance_name = org_data["instance"]["name"]
org_name = org_data["name"]
Expand Down
Loading