Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e2dc06e
Bump pygments from 2.19.2 to 2.20.0
dependabot[bot] Mar 30, 2026
b7718fa
Merge branch 'master' into dependabot/pip/pygments-2.20.0
prasadmatcha Mar 31, 2026
d110215
Merge pull request #578 from NHSDigital/dependabot/pip/pygments-2.20.0
prasadmatcha Mar 31, 2026
aaa70da
Bump click from 8.3.1 to 8.3.2 (#584)
dependabot[bot] Apr 6, 2026
ea74189
Bump cryptography from 46.0.6 to 46.0.7 (#585)
dependabot[bot] Apr 8, 2026
034439d
Bump pytest from 9.0.2 to 9.0.3 (#586)
dependabot[bot] Apr 9, 2026
305efc0
Bump actions/upload-artifact from 7.0.0 to 7.0.1 (#588)
dependabot[bot] Apr 17, 2026
3c1be50
Bump actions/cache from 5.0.4 to 5.0.5 (#589)
dependabot[bot] Apr 20, 2026
237cee2
Bump ansible-core from 2.19.8 to 2.19.9 (#590)
dependabot[bot] Apr 21, 2026
baa0d30
Bump gitpython from 3.1.46 to 3.1.47 (#592)
dependabot[bot] Apr 22, 2026
a452e83
Bump click from 8.3.2 to 8.3.3 (#594)
dependabot[bot] Apr 23, 2026
2860216
Bump lxml from 5.4.0 to 6.1.0
dependabot[bot] Apr 23, 2026
c439c7e
APM-7202-Dependabot-interval
Valswyn-NHS Apr 23, 2026
021a0d1
Merge pull request #595 from NHSDigital/APM-7202-Dependabot-interval
sathiya-nhs Apr 23, 2026
f9772d5
Bump gitpython from 3.1.47 to 3.1.49 (#596)
dependabot[bot] Apr 30, 2026
1bfacb7
Bump gitpython from 3.1.49 to 3.1.50 (#598)
dependabot[bot] May 7, 2026
0a40a3b
Refactor YAML parameters and improve variable handling across multipl…
sathiya-nhs May 11, 2026
3fe7ce1
Refactor YAML scripts for improved variable handling and consistency
sathiya-nhs May 11, 2026
ab194ed
Refactor environment variable handling in YAML files for consistency
sathiya-nhs May 11, 2026
039bbd4
Fix variable assignment syntax for Python version in apigee-build.yml
sathiya-nhs May 11, 2026
632dc77
Refactor variable usage in deploy-service.yml for consistency and cla…
sathiya-nhs May 11, 2026
dac4c6d
Refactor YAML scripts for improved consistency and clarity in variabl…
sathiya-nhs May 11, 2026
90af4e9
Enhance manifest validation to conditionally update spec paths based …
sathiya-nhs May 11, 2026
4e622d7
Refactor function signatures in env_cleaner.py to remove unused param…
sathiya-nhs May 11, 2026
7075189
Fix formatting in add_policy_to_pre_flow.py and update type hint in a…
sathiya-nhs May 11, 2026
c25f7ba
Refactor type hints in product.py and rate_limiting_config.py to use …
sathiya-nhs May 11, 2026
a4eb823
Refactor code for improved readability and consistency in update_sche…
sathiya-nhs May 11, 2026
1fea385
Refactor code for improved readability and consistency in calculate_v…
sathiya-nhs May 11, 2026
1737b63
Refactor prepend_dist_dir_to_spec_paths in validate_manifest.py for c…
sathiya-nhs May 11, 2026
55390cf
Remove unused min_age parameter from clean_specs function in env_clea…
sathiya-nhs May 11, 2026
62a5bdf
Add environment variable for service_name in apigee-build.yml check w…
sathiya-nhs May 11, 2026
3cc6eb5
Debug
sathiya-nhs May 11, 2026
212e214
Refactor deploy-service.yml to remove redundant variable declarations…
sathiya-nhs May 12, 2026
076124b
Fix formatting inconsistencies in deploy-stage.yml and update display…
sathiya-nhs May 12, 2026
611eaf6
Refactor code for consistency and clarity across multiple files, incl…
sathiya-nhs May 12, 2026
8524fba
Update s3-cache-action version to 1.3.4 in multiple YAML files for co…
sathiya-nhs May 12, 2026
243b081
Update display_name field to use alias displayName for consistency wi…
sathiya-nhs May 12, 2026
dfa5be4
Refactor display_name field to displayName for consistency with API s…
sathiya-nhs May 12, 2026
ce6bb81
Bump urllib3 from 2.6.3 to 2.7.0
dependabot[bot] May 14, 2026
06b690f
Merge pull request #602 from NHSDigital/dependabot/pip/master/urllib3…
amitkr-22 May 15, 2026
b0da2db
Bump requests from 2.32.5 to 2.34.2
dependabot[bot] May 15, 2026
cd927d2
Merge pull request #601 from NHSDigital/dependabot/pip/master/request…
amitkr-22 May 15, 2026
4befeb3
Merge branch 'master' into dependabot/pip/lxml-6.1.0
amitkr-22 May 15, 2026
f1d754a
Merge pull request #591 from NHSDigital/dependabot/pip/lxml-6.1.0
amitkr-22 May 15, 2026
e25ceaa
Merge branch 'master' into APM-7323-Sonarqube-fix
sathiya-nhs May 18, 2026
5852e43
Merge pull request #599 from NHSDigital/APM-7323-Sonarqube-fix
sathiya-nhs May 18, 2026
81a480e
Fix variable reference for source branch in setup-build-name.yml
sathiya-nhs May 18, 2026
25e1bc1
Merge branch 'APM-7323-Sonarqube-fix' of https://github.com/NHSDigita…
sathiya-nhs May 18, 2026
cd12702
Merge branch 'master' into APM-7323-Sonarqube-fix
sathiya-nhs May 18, 2026
e21dea9
Merge pull request #603 from NHSDigital/APM-7323-Sonarqube-fix
saptarshimandal1 May 18, 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
24 changes: 12 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,50 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "master"
labels: ["dependencies", "python", "poetry"]
labels: [ "dependencies", "python", "poetry" ]
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
update-types: [ "version-update:semver-major" ]

# ---------------------------
# NodeJS (root)
# ---------------------------
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "master"
labels: ["dependencies", "npm"]
labels: [ "dependencies", "npm" ]
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
update-types: [ "version-update:semver-major" ]

# ---------------------------
# NodeJS (sandbox/)
# ---------------------------
- package-ecosystem: "npm"
directory: "/sandbox"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "master"
labels: ["dependencies", "npm", "sandbox"]
labels: [ "dependencies", "npm", "sandbox" ]
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
update-types: [ "version-update:semver-major" ]

# ---------------------------
# GitHub Actions
# ---------------------------
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
target-branch: "master"
labels: ["dependencies", "github-actions"]
labels: [ "dependencies", "github-actions" ]
cooldown:
default-days: 7
default-days: 7
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: pip install poetry

- name: Cache poetry packages
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache
with:
path: ~/.venv
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
python .github/scripts/sbom_json_to_csv.py sbom.json SBOM_${REPO_NAME}.csv

- name: Upload SBOM CSV as artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom-csv
path: SBOM_${{ github.event.repository.name }}.csv
Expand All @@ -89,7 +89,7 @@ jobs:
python .github/scripts/grype_json_to_csv.py grype-report.json grype-report-${REPO_NAME}.csv

- name: Upload Vulnerability Report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: grype-report
path: grype-report-${{ github.event.repository.name }}.csv
Expand All @@ -101,7 +101,7 @@ jobs:
python .github/scripts/sbom_packages_to_csv.py sbom.json $REPO_NAME

- name: Upload Package Inventory CSV
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sbom-packages
path: sbom-packages-${{ github.event.repository.name }}.csv
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run(self, tmp=None, task_vars=None):
proxies_dir = args.dist_dir.joinpath(
"proxies", args.proxy_dir, "apiproxy/proxies"
)
proxies_files = [f for f in proxies_dir.glob("*.xml")]
proxies_files = list(proxies_dir.glob("*.xml"))

if len(proxies_files) != 1:
return {
Expand All @@ -57,13 +57,12 @@ def run(self, tmp=None, task_vars=None):
name = step.find("Name")
if name.text == args.policy_name:
return {"changed": False}
break

result = {"changed": True}
if diff_mode:
result["diff"] = {
"before": etree.tostring(tree, pretty_print=True).decode(),
"before_header": str(proxies_file)
"before_header": str(proxies_file),
}

step = etree.Element("Step")
Expand All @@ -76,8 +75,8 @@ def run(self, tmp=None, task_vars=None):
result["diff"].update(
{
"after": etree.tostring(tree, pretty_print=True).decode(),
"after_header": str(proxies_file)
}
"after_header": str(proxies_file),
}
)

if check_mode or result["changed"] is False:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@


class ApigeeAction(ansible.plugins.action.ActionBase):
def validate_args(self, Validator: pydantic.BaseModel):
def validate_args(self, validator: type[pydantic.BaseModel]):
"""Returns two-length tuple of validated_args and errors dicts."""
try:
args = Validator(**self._task.args)
args = validator(**self._task.args)
return args, {}
except pydantic.ValidationError as e:
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def check_service_name(cls, service_name, values):
def prepend_dist_dir_to_spec_paths(cls, manifest, values):
dist_dir = values.get("dist_dir")
print(dist_dir)
if not dist_dir:
return manifest
apigee = manifest["apigee"]
for env_dict in apigee["environments"]:
for spec_dict in env_dict["specs"]:
path = spec_dict.get("path")
if path is not None:
spec_dict["path"] = os.path.join(dist_dir, path)
if dist_dir:
apigee = manifest["apigee"]
for env_dict in apigee["environments"]:
for spec_dict in env_dict["specs"]:
path = spec_dict.get("path")
if path is not None:
spec_dict["path"] = os.path.join(dist_dir, path)

return manifest

@pydantic.validator("manifest")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import Union, Literal, List, Dict, Any, Type
from typing import Optional, Union, Literal, List, Dict, Any, Type
from typing_extensions import Annotated
from pydantic import (
Field,
Expand Down Expand Up @@ -110,29 +110,34 @@ def _literal_name(class_):
+ ")$)"
)


class ApigeeProductAttributeOther(BaseModel):
name: constr(regex=PRODUCT_ATTRIBUTE_REGEX)
value: str


ApigeeProductAttributeSpecial = Annotated[
Union [
Union[
ApigeeProductAttributeAccess,
ApigeeProductAttributeRateLimit,
ApigeeProductAttributeRateLimiting,
],
Field(discriminator="name")
Field(discriminator="name"),
]


def _count_cls(items: List[Any], cls: Type):
return sum(isinstance(item, cls) for item in items)


class ApigeeProduct(BaseModel):
name: str
approvalType: Literal["auto", "manual"] = "manual"
attributes: List[Union[ApigeeProductAttributeSpecial, ApigeeProductAttributeOther]] = [{"name": "access", "value": "private"}]
description: str = None
displayName: str = None
attributes: List[
Union[ApigeeProductAttributeSpecial, ApigeeProductAttributeOther]
] = [{"name": "access", "value": "private"}]
description: Optional[str] = None
displayName: Optional[str] = None

# Note: This value is manually inserted by apigee_environment
# object that contains this product. So if you do not provide a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
Pydantic class for the rateliming config JSON, attached to products
and apps to control the ApplyRateLimiting shared flow.
"""
from typing import Literal

from typing import Literal, Optional

from pydantic import BaseModel, conint, constr, Extra


class ExcludeNoneModel(BaseModel):

"""
Providing default values for ratelimiting here would mean that
changing defaults required a redeploy for all proxies.
Expand All @@ -21,26 +21,27 @@ class ExcludeNoneModel(BaseModel):
update the defaults for everyone by just by updating the shared
flow.
"""

def dict(self, **kwargs):
kwargs["exclude_none"] = True
return super().dict(**kwargs)

class Config:
extra=Extra.forbid
extra = Extra.forbid


class QuotaConfig(ExcludeNoneModel):
enabled: bool = None
enabled: Optional[bool] = None
interval: conint(gt=0) = None
limit: conint(gt=0) = None
timeunit: Literal["minute", "hour", "day", "week", "month"] = None


class SpikeArrestConfig(ExcludeNoneModel):
enabled: bool = None
ratelimit: constr(regex=r"^[1-9][0-9]*(ps|pm)$") = None
enabled: Optional[bool] = None
ratelimit: Optional[constr(regex=r"^[1-9][0-9]*(ps|pm)$")] = None


class RateLimitingConfig(ExcludeNoneModel):
quota: QuotaConfig = None
spikeArrest: SpikeArrestConfig = None
quota: Optional[QuotaConfig] = None
spikeArrest: Optional[SpikeArrestConfig] = None
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
_REGISTRY_DATA = {}



class ManifestMetaApi(pydantic.BaseModel):
name: pydantic.constr(regex=r"^[a-z][a-z0-9]*(-[a-z0-9]+)*$")
id: typing.Optional[pydantic.UUID4] = pydantic.Field(
Expand All @@ -29,7 +28,7 @@ def dict(self, **kwargs):
{
"guid": str(native["guid"]),
"spec_guids": [str(guid) for guid in spec_guids],
}
}
)
return native

Expand Down Expand Up @@ -58,7 +57,9 @@ def validate_guid(cls, guid, values):
guid = _REGISTRY_DATA[name]["guid"]
registered_guid = _REGISTRY_DATA[name]["guid"]
if str(guid) != registered_guid:
raise ValueError(f"Supplied guid {guid} does not match registered guid {registered_guid}")
raise ValueError(
f"Supplied guid {guid} does not match registered guid {registered_guid}"
)
return guid

@pydantic.validator("spec_guids")
Expand All @@ -78,11 +79,12 @@ def validate_spec_guids(cls, spec_guids, values):
if str(spec_guid) not in registered_spec_guids:
invalid.append(str(spec_guid))
if len(invalid) > 0:
raise ValueError(f"Supplied spec_guids {invalid} do not match registered spec_guids {registered_spec_guids}")
raise ValueError(
f"Supplied spec_guids {invalid} do not match registered spec_guids {registered_spec_guids}"
)
return spec_guids



class ManifestMeta(pydantic.BaseModel):
schema_version: pydantic.constr(regex=r"[1-9][0-9]*(\.[0-9]+){0,2}")
api: ManifestMetaApi
Expand All @@ -91,7 +93,7 @@ class ManifestMeta(pydantic.BaseModel):
def validate_schema_version(cls, schema_version):
semantic_parts = schema_version.split(".")

MAJOR, MINOR, PATCH = [int(x) for x in SCHEMA_VERSION.split(".")]
MAJOR, _, _ = [int(x) for x in SCHEMA_VERSION.split(".")]
major = int(semantic_parts[0])

# Checking against minor/patch would not allow to us deploy
Expand Down
Loading
Loading