Fix resources isues 29
This commit is contained in:
@@ -40,13 +40,27 @@ spec:
|
|||||||
|
|
||||||
cd $(workspaces.source.path)
|
cd $(workspaces.source.path)
|
||||||
|
|
||||||
|
echo "Git log (last 3 commits):"
|
||||||
|
git log --oneline -3 || echo "Cannot get git log"
|
||||||
|
|
||||||
|
# Check if we have enough history for comparison
|
||||||
|
COMMIT_COUNT=$(git rev-list --count HEAD 2>/dev/null || echo "0")
|
||||||
|
echo "Commit count in history: $COMMIT_COUNT"
|
||||||
|
|
||||||
|
if [ "$COMMIT_COUNT" -lt 2 ]; then
|
||||||
|
echo "Not enough git history for change detection (need at least 2 commits)"
|
||||||
|
echo "Building all services as fallback"
|
||||||
|
echo "all" > $(results.changed-services.path)
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the list of changed files
|
# Get the list of changed files
|
||||||
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "")
|
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$CHANGED_FILES" ]; then
|
if [ -z "$CHANGED_FILES" ]; then
|
||||||
# No changes detected, assume all services need building
|
# Empty commit or something unusual - skip build
|
||||||
echo "No git changes detected, building all services"
|
echo "No file changes detected in last commit"
|
||||||
echo "all" > $(results.changed-services.path)
|
echo "infrastructure" > $(results.changed-services.path)
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ spec:
|
|||||||
default: "main"
|
default: "main"
|
||||||
- name: depth
|
- name: depth
|
||||||
type: string
|
type: string
|
||||||
description: Git clone depth (0 for full history)
|
description: Git clone depth (0 for full history, minimum 2 for change detection)
|
||||||
default: "1"
|
default: "2"
|
||||||
results:
|
results:
|
||||||
- name: commit-sha
|
- name: commit-sha
|
||||||
description: The commit SHA that was checked out
|
description: The commit SHA that was checked out
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ logger = structlog.get_logger()
|
|||||||
router = APIRouter(prefix="/plans", tags=["subscription-plans"])
|
router = APIRouter(prefix="/plans", tags=["subscription-plans"])
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=Dict[str, Any])
|
@router.get("/", response_model=Dict[str, Any])
|
||||||
async def get_available_plans():
|
async def get_available_plans():
|
||||||
"""
|
"""
|
||||||
Get all available subscription plans with complete metadata
|
Get all available subscription plans with complete metadata
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ def determine_status(usage_percentage: float, days_until_breach: Optional[int])
|
|||||||
return 'safe'
|
return 'safe'
|
||||||
|
|
||||||
|
|
||||||
@router.get("", response_model=UsageForecastResponse)
|
@router.get("/", response_model=UsageForecastResponse)
|
||||||
async def get_usage_forecast(
|
async def get_usage_forecast(
|
||||||
tenant_id: str = Query(..., description="Tenant ID"),
|
tenant_id: str = Query(..., description="Tenant ID"),
|
||||||
current_user: dict = Depends(get_current_user_dep)
|
current_user: dict = Depends(get_current_user_dep)
|
||||||
|
|||||||
@@ -110,6 +110,29 @@ class OTelConfig:
|
|||||||
|
|
||||||
return endpoints
|
return endpoints
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _contains_secret_reference(endpoint: str) -> bool:
|
||||||
|
"""
|
||||||
|
Check if endpoint contains secret references or placeholders.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
endpoint: Endpoint string to check
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
True if endpoint contains secret references, False otherwise
|
||||||
|
"""
|
||||||
|
# Check for common secret reference patterns
|
||||||
|
secret_patterns = [
|
||||||
|
'${', '{{', '}}', 'SECRET', 'PASSWORD', 'TOKEN', 'API_KEY'
|
||||||
|
]
|
||||||
|
|
||||||
|
endpoint_upper = endpoint.upper()
|
||||||
|
for pattern in secret_patterns:
|
||||||
|
if pattern in endpoint or pattern in endpoint_upper:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _clean_grpc_endpoint(endpoint: str) -> str:
|
def _clean_grpc_endpoint(endpoint: str) -> str:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user