Skip to content

chore: Dev to main#710

Open
NirajC-Microsoft wants to merge 56 commits intomainfrom
dev
Open

chore: Dev to main#710
NirajC-Microsoft wants to merge 56 commits intomainfrom
dev

Conversation

@NirajC-Microsoft
Copy link
Contributor

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:

  • Added a workflow for checking broken links in Markdown files using lycheeverse/lychee-action, triggered on PRs and manual dispatch (.github/workflows/broken-links-checker.yml).
  • Introduced a CodeQL workflow for static code analysis of Python files, running on pushes, PRs, and a weekly schedule (.github/workflows/codeql.yml).
  • Added a PyLint workflow that runs flake8 on backend Python code on relevant pushes, ensuring code style consistency (.github/workflows/pylint.yml).
  • Implemented a workflow to validate the presence and correctness of the template: property in content-gen/azure.yaml for telemetry tracking (.github/workflows/telemetry-template-check.yml).
  • Added a workflow to run backend Python tests with coverage reporting, skipping tests if none are found (.github/workflows/test.yml).
  • Introduced a stale bot workflow to automatically mark stale issues/PRs and generate reports on inactive and merged branches (.github/workflows/stale-bot.yml).

Python Linting Standardization:

  • Added a .flake8 configuration file to set linting rules, ignored errors, and exclude certain directories.

Documentation and Usability Improvements:

  • Updated README.md and content-gen/README.md to fix links to documentation files and clarify license location. [1] [2]
  • Improved the deployment guide (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:

  • Updated references to the correct environment variable for AI service location in content-gen/azure.yaml. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Kingshuk-Microsoft and others added 30 commits February 4, 2026 14:00
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
…orchestrator.py; add model availability check in quota_check_params.sh
@github-advanced-security
Copy link

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +50 to +51
@description('Required. Location for AI deployments.')
param azureAiServiceLocation string
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested 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

Copilot uses AI. Check for mistakes.
Comment on lines 1532 to 1537
except Exception:
logger.debug(
"Failed to parse JSON image prompt from markdown code block; "
"continuing with original prompt_text.",
exc_info=True
)
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines 1600 to 1602
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)
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 335 to 348
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('');
};
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants