Skip to content

Commit

Permalink
jira-permissions-validator: use static sharding (#4818)
Browse files Browse the repository at this point in the history
* ⚰️ remove unused per-jira-board sharding strategy

* jira-permissions-validator: use static sharding
  • Loading branch information
chassing authored Jan 23, 2025
1 parent fad0e58 commit a3765b0
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 317 deletions.
7 changes: 6 additions & 1 deletion reconcile/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,14 +1158,18 @@ def jenkins_webhooks_cleaner(ctx):


@integration.command(short_help="Validate permissions in Jira.")
@click.option("--jira-board-name", help="The Jira board to act on.", default=None)
@click.option(
"--jira-board-name", help="The Jira board to act on.", default=None, multiple=True
)
@click.option("--board-check-interval", help="Check interval in minutes", default=120)
@enable_extended_early_exit
@extended_early_exit_cache_ttl_seconds
@log_cached_log_output
@click.pass_context
def jira_permissions_validator(
ctx,
jira_board_name,
board_check_interval,
enable_extended_early_exit,
extended_early_exit_cache_ttl_seconds,
log_cached_log_output,
Expand All @@ -1176,6 +1180,7 @@ def jira_permissions_validator(
reconcile.jira_permissions_validator,
ctx.obj,
jira_board_name=jira_board_name,
board_check_interval=board_check_interval,
enable_extended_early_exit=enable_extended_early_exit,
extended_early_exit_cache_ttl_seconds=extended_early_exit_cache_ttl_seconds,
log_cached_log_output=log_cached_log_output,
Expand Down
16 changes: 0 additions & 16 deletions reconcile/gql_definitions/integrations/integrations.gql
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,6 @@ query Integrations {
}
}
}

... on JiraBoardSharding_v1 {
shardSpecOverrides {
shard {
name
disable {
integrations
}
}
imageRef
disabled
resources {
... DeployResourcesFields
}
}
}
}
}
}
Expand Down
38 changes: 1 addition & 37 deletions reconcile/gql_definitions/integrations/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,6 @@
}
}
}
... on JiraBoardSharding_v1 {
shardSpecOverrides {
shard {
name
disable {
integrations
}
}
imageRef
disabled
resources {
... DeployResourcesFields
}
}
}
}
}
}
Expand Down Expand Up @@ -358,30 +342,10 @@ class CloudflareDNSZoneShardingV1(IntegrationShardingV1):
shard_spec_overrides: Optional[list[CloudflareDNSZoneShardSpecOverrideV1]] = Field(..., alias="shardSpecOverrides")


class DisableJiraBoardAutomationsV1(ConfiguredBaseModel):
integrations: Optional[list[str]] = Field(..., alias="integrations")


class JiraBoardV1(ConfiguredBaseModel):
name: str = Field(..., alias="name")
disable: Optional[DisableJiraBoardAutomationsV1] = Field(..., alias="disable")


class JiraBoardShardSpecOverrideV1(ConfiguredBaseModel):
shard: JiraBoardV1 = Field(..., alias="shard")
image_ref: Optional[str] = Field(..., alias="imageRef")
disabled: Optional[bool] = Field(..., alias="disabled")
resources: Optional[DeployResourcesFields] = Field(..., alias="resources")


class JiraBoardShardingV1(IntegrationShardingV1):
shard_spec_overrides: Optional[list[JiraBoardShardSpecOverrideV1]] = Field(..., alias="shardSpecOverrides")


class IntegrationManagedV1(ConfiguredBaseModel):
namespace: NamespaceV1 = Field(..., alias="namespace")
spec: IntegrationSpecV1 = Field(..., alias="spec")
sharding: Optional[Union[StaticShardingV1, OpenshiftClusterShardingV1, OCMOrganizationShardingV1, AWSAccountShardingV1, CloudflareDNSZoneShardingV1, JiraBoardShardingV1, IntegrationShardingV1]] = Field(..., alias="sharding")
sharding: Optional[Union[StaticShardingV1, OpenshiftClusterShardingV1, OCMOrganizationShardingV1, AWSAccountShardingV1, CloudflareDNSZoneShardingV1, IntegrationShardingV1]] = Field(..., alias="sharding")


class IntegrationV1(ConfiguredBaseModel):
Expand Down
121 changes: 0 additions & 121 deletions reconcile/gql_definitions/introspection.json
Original file line number Diff line number Diff line change
Expand Up @@ -29766,11 +29766,6 @@
"kind": "OBJECT",
"name": "AWSAccountSharding_v1",
"ofType": null
},
{
"kind": "OBJECT",
"name": "JiraBoardSharding_v1",
"ofType": null
}
]
},
Expand Down Expand Up @@ -49774,122 +49769,6 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "JiraBoardSharding_v1",
"description": null,
"fields": [
{
"name": "strategy",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "shardSpecOverrides",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "JiraBoardShardSpecOverride_v1",
"ofType": null
}
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
{
"kind": "INTERFACE",
"name": "IntegrationSharding_v1",
"ofType": null
}
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "JiraBoardShardSpecOverride_v1",
"description": null,
"fields": [
{
"name": "shard",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "JiraBoard_v1",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "imageRef",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "resources",
"description": null,
"args": [],
"type": {
"kind": "OBJECT",
"name": "DeployResources_v1",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "disabled",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "StaticSubSharding_v1",
Expand Down
7 changes: 0 additions & 7 deletions reconcile/gql_definitions/sharding/jira_boards.gql

This file was deleted.

60 changes: 0 additions & 60 deletions reconcile/gql_definitions/sharding/jira_boards.py

This file was deleted.

2 changes: 0 additions & 2 deletions reconcile/integrations_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
AWSAccountShardingStrategy,
CloudflareDnsZoneShardingStrategy,
IntegrationShardManager,
JiraBoardShardingStrategy,
OCMOrganizationShardingStrategy,
OpenshiftClusterShardingStrategy,
ShardSpec,
Expand Down Expand Up @@ -258,7 +257,6 @@ def run(
OpenshiftClusterShardingStrategy.IDENTIFIER: OpenshiftClusterShardingStrategy(),
CloudflareDnsZoneShardingStrategy.IDENTIFIER: CloudflareDnsZoneShardingStrategy(),
OCMOrganizationShardingStrategy.IDENTIFIER: OCMOrganizationShardingStrategy(),
JiraBoardShardingStrategy.IDENTIFIER: JiraBoardShardingStrategy(),
},
integration_runtime_meta=integration_runtime_meta,
)
Expand Down
Loading

0 comments on commit a3765b0

Please sign in to comment.