Skip to content

refactor: code quality fixes#631

Closed
Ayaz-Microsoft wants to merge 3 commits into
mainfrom
code-quality-ayaz
Closed

refactor: code quality fixes#631
Ayaz-Microsoft wants to merge 3 commits into
mainfrom
code-quality-ayaz

Conversation

@Ayaz-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

Code quality enhancement

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on code quality and security hardening across the frontend and backend by replacing potentially risky patterns (regex/Math.random/SHA1) and tightening runtime defaults (Swagger exposure, security headers).

Changes:

  • Frontend: replace a URL-stripping regex with a linear helper; update UUID generation to use crypto.randomUUID() / secure random bytes.
  • Backend: replace SHA1 with SHA256 for partition key derivation; restrict Swagger UI to Development only; refine Azure credential selection in Development.
  • Ops: add common security headers in the frontend IIS web.config.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
App/frontend-app/src/components/documentViewer/pageNumberTab.tsx Replaces URL prefix-stripping regex with a helper function.
App/frontend-app/src/components/chat/chatRoom.tsx Updates UUID generation to use cryptographically secure APIs.
App/frontend-app/public/web.config Adds security-related HTTP response headers.
App/backend-api/Microsoft.GS.DPS/Storage/Components/CosmosDBEntityBase.cs Switches partition key hashing from SHA1 to SHA256.
App/backend-api/Microsoft.GS.DPS.Host/Program.cs Gates Swagger/SwaggerUI to Development environment.
App/backend-api/Microsoft.GS.DPS.Host/Helpers/AzureCredentialHelper.cs Uses ChainedTokenCredential for Development to support AKS + local dev flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread App/frontend-app/src/components/documentViewer/pageNumberTab.tsx Outdated
Comment thread App/frontend-app/src/components/chat/chatRoom.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread App/frontend-app/src/components/documentViewer/pageNumberTab.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 11, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

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.

2 participants