Skip to content

Commit f3ca4f4

Browse files
committed
get rhel release graph url from environment variable
1 parent 25102b5 commit f3ca4f4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export AUTH_ENDPOINT="https://auth.stage.redhat.com/auth/realms/EmployeeIDP/prot
3030
Product Mapping:
3131
```bash
3232
export PRODDEFS_URL="https://prodsec.pages.example.com/product-definitions/products.json"
33+
export RHEL_RELEASE_GRAPH_URL="https://gitlab.cee.example.com/api/v4/projects/prodsec%2Frhel-release-graph"
3334
export SSL_CERT_FILE=/etc/pki/tls/certs/ca-bundle.crt
3435
```
3536

src/trustshell/rhel_releases.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ def __repr__(self) -> str:
3939
class RHELReleaseData:
4040
"""Parser and manager for RHEL release data from GitLab repository or local files."""
4141

42-
# Default GitLab repository configuration
43-
DEFAULT_REPO_BASE = (
44-
"https://gitlab.cee.redhat.com/api/v4/projects/prodsec%2Frhel-release-graph"
42+
# GitLab repository configuration (can be overridden with RHEL_RELEASE_GRAPH_URL env var)
43+
RHEL_RELEASE_GRAPH_BASE = os.environ.get(
44+
"RHEL_RELEASE_GRAPH_URL",
45+
"https://gitlab.cee.redhat.com/api/v4/projects/prodsec%2Frhel-release-graph",
4546
)
4647
DEFAULT_FILE_PATH = "rhel9-releases.yml"
4748
DEFAULT_BRANCH = "main"
@@ -117,9 +118,7 @@ def _fetch_from_gitlab(self) -> Optional[Dict[str, Any]]:
117118
# Build GitLab API URL for the file
118119
# URL format: /projects/:id/repository/files/:file_path/raw?ref=:branch
119120
encoded_file_path = self.file_path.replace("/", "%2F")
120-
file_url = (
121-
f"{self.DEFAULT_REPO_BASE}/repository/files/{encoded_file_path}/raw"
122-
)
121+
file_url = f"{self.RHEL_RELEASE_GRAPH_BASE}/repository/files/{encoded_file_path}/raw"
123122

124123
# Load cached ETag if available
125124
cached_etag = self._load_cached_etag(etag_file)

0 commit comments

Comments
 (0)