Conversation
fix: down merge to dev from main
- Cleaned up whitespace and formatting in blob_service.py, cosmos_service.py, search_service.py, and settings.py. - Ensured consistent spacing and indentation throughout the codebase. - Enhanced code clarity by removing unnecessary blank lines and aligning comments. - No functional changes were made; this commit focuses solely on code style improvements.
…emetry template validation, and backend testing
…Azure identity import handling
…cripts for quota verification
… parsing failures
…orchestrator.py; add model availability check in quota_check_params.sh
…ve unused fallback logic
…te and pagination for better accuracy
… and update documentation for login command
…testing, and repository maintenance
…ted deployment.md with waf deployment steps
…-solution-accelerator into rc-readmeupdates
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This pull request introduces comprehensive CI/CD automation, infrastructure improvements, and documentation updates for the Content Generation Solution Accelerator. The primary changes include new GitHub Actions workflows for quality checks, updates to Azure infrastructure templates to make AI service location selection more robust, Python code formatting standardization, frontend validation improvements, and enhanced documentation.
Changes:
- Added 6 new GitHub Actions workflows for code quality, security scanning, link checking, testing, stale issue management, and telemetry validation
- Updated infrastructure to require explicit AI service location selection with quota-aware metadata
- Standardized Python code formatting with .flake8 configuration
- Added conversation rename validation in the frontend chat history component
- Enhanced deployment documentation with quota checking guidance and clearer deployment instructions
Reviewed changes
Copilot reviewed 26 out of 38 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/*.yml | Added 6 new workflows for CI/CD automation (broken links, CodeQL, PyLint, tests, stale bot, telemetry check) |
| .flake8 | Added Python linting configuration for consistent code style |
| content-gen/infra/main.bicep | Changed azureAiServiceLocation to required parameter with quota-aware metadata; added role assignment module |
| content-gen/infra/main.json | Compiled Bicep changes with updated template hash and version |
| content-gen/infra/modules/deploy_foundry_role_assignment.bicep | New module for RBAC role assignments on existing AI services |
| content-gen/infra/scripts/quota_check_params.sh | New script for checking Azure OpenAI quota availability before deployment |
| content-gen/src/backend/*.py | Whitespace formatting changes (trailing whitespace removal) for code consistency |
| content-gen/src/backend/orchestrator.py | Improved error handling with better exception logging in image generation paths |
| content-gen/src/app/frontend/src/components/ChatHistory.tsx | Added validation for conversation rename with error messaging |
| content-gen/docs/*.md | Multiple documentation improvements for deployment, quota checking, and resource cleanup |
| content-gen/azure.yaml | Updated environment variable reference from AI_SERVICE_LOCATION to AZURE_ENV_OPENAI_LOCATION |
| README.md | Updated documentation links to point to correct locations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @description('Required. Location for AI deployments.') | ||
| param azureAiServiceLocation string |
There was a problem hiding this comment.
The azureAiServiceLocation parameter is now required (no default value), but the metadata usageName values are hardcoded as compile-time constants. If deployers need different model capacities, they would need to manually update both the bicep metadata AND their deployment parameters, which creates a maintenance burden and potential for mismatch. Consider either: (1) making azureAiServiceLocation optional with a default value, or (2) adding a comment warning that the usageName metadata must be manually updated if model parameters change.
| @description('Required. Location for AI deployments.') | |
| param azureAiServiceLocation string | |
| @description('Optional. Location for AI deployments. Defaults to the main deployment location.') | |
| param azureAiServiceLocation string = location |
| except Exception: | ||
| logger.debug( | ||
| "Failed to parse JSON image prompt from markdown code block; " | ||
| "continuing with original prompt_text.", | ||
| exc_info=True | ||
| ) |
There was a problem hiding this comment.
The bare except clauses (lines 1532-1533 and 1770-1777) catch all exceptions including system-exiting exceptions like KeyboardInterrupt and SystemExit. This is generally considered bad practice. Use 'except Exception:' instead to catch only normal exceptions, or specify the expected exception types explicitly (e.g., json.JSONDecodeError, KeyError).
| except (json.JSONDecodeError, KeyError): | ||
| pass | ||
|
|
||
| # Failed to parse compliance response JSON; violations will remain empty | ||
| logger.debug("Could not parse compliance violations from response", exc_info=True) |
There was a problem hiding this comment.
The bare except clause (lines 1601-1602) catches all exceptions including system-exiting exceptions. Use 'except (json.JSONDecodeError, KeyError):' instead to be more specific about which exceptions you're handling.
| const handleRenameConfirm = async () => { | ||
| const trimmedValue = renameValue.trim(); | ||
| if (trimmedValue && trimmedValue !== conversation.title) { | ||
| await onRename(conversation.id, trimmedValue); | ||
| onRefresh(); | ||
|
|
||
| if (trimmedValue === conversation.title) { | ||
| setIsRenameDialogOpen(false); | ||
| setRenameError(''); | ||
| return; | ||
| } | ||
|
|
||
| await onRename(conversation.id, trimmedValue); | ||
| onRefresh(); | ||
| setIsRenameDialogOpen(false); | ||
| setRenameError(''); | ||
| }; |
There was a problem hiding this comment.
The validation logic allows submitting an empty/whitespace-only conversation name if the user doesn't change the title (line 338-341). This means the "Rename" action could technically be performed with the same title, which is fine, but there's no validation preventing submission when renameValue.trim() is empty if the user manually clears the field and then the condition on line 338 evaluates to false. The disabled state on line 500 does prevent submission, but consider also showing the error immediately when the field is cleared.
Removed unused variables and logging for execution time.
Ensure logger handler is removed in all cases.
Purpose
This pull request introduces several new GitHub Actions workflows to automate code quality checks, stale issue/branch management, and deployment validation. It also standardizes Python linting configuration and makes documentation improvements for clarity and maintainability. The most important changes are grouped below.
CI/CD and Automation Enhancements:
lycheeverse/lychee-action, triggered on PRs and manual dispatch (.github/workflows/broken-links-checker.yml)..github/workflows/codeql.yml).flake8on backend Python code on relevant pushes, ensuring code style consistency (.github/workflows/pylint.yml).template:property incontent-gen/azure.yamlfor telemetry tracking (.github/workflows/telemetry-template-check.yml)..github/workflows/test.yml)..github/workflows/stale-bot.yml).Python Linting Standardization:
.flake8configuration file to set linting rules, ignored errors, and exclude certain directories.Documentation and Usability Improvements:
README.mdandcontent-gen/README.mdto fix links to documentation files and clarify license location. [1] [2]content-gen/docs/AZD_DEPLOYMENT.md) by clarifying Azure login instructions, restructuring deployment configuration steps, removing redundant parameter tables, and refining troubleshooting sections. [1] [2] [3] [4] [5] [6] [7]Minor Configuration Fixes:
content-gen/azure.yaml. [1] [2]Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information