Skip to content

SSO Metadata Upload Fix #1553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025
Merged

SSO Metadata Upload Fix #1553

merged 1 commit into from
Apr 4, 2025

Conversation

Yibaebi
Copy link
Contributor

@Yibaebi Yibaebi commented Apr 4, 2025

No description provided.

Copy link

coderabbitai bot commented Apr 4, 2025

Walkthrough

This update removes the explicit contentType setting from an AJAX request in the SSO settings component. In addition, it refines the HTTP header handling and response parsing logic in the AJAX service. The service now conditionally omits the Content-Type header when dealing with FormData or Blob data and enforces a stricter type constraint on the parsed response to enhance type safety.

Changes

File(s) Change Summary
app/components/sso-settings/index.ts Removed the contentType property in the AJAX post request for uploadIdPMetadata, allowing the default content type determination.
app/services/ajax.ts Updated header handling to omit Content-Type for FormData/Blob data and modified the parseResponseText method signature to enforce type safety (T extends object).

Possibly related PRs

Suggested Reviewers

  • future-pirate-king

Poem

I'm a rabbit coding with glee,
Hopping through headers so magically free.
Content types now skip the fuss,
With tighter types, no mistakes to discuss.
Carrots and code in perfect harmony—
A joyful jump in our debugging spree!
🥕🐰 Happy hops to clearer code!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @storybook/[email protected]
npm error Found: [email protected]
npm error node_modules/ember-source
npm error dev ember-source@"~5.12.0" from the root project
npm error peer ember-source@">= 3.28.12" from @ember-data/[email protected]
npm error node_modules/@ember-data/tracking
npm error peer @ember-data/tracking@"5.3.9" from @ember-data/[email protected]
npm error node_modules/@ember-data/model
npm error peer @ember-data/model@"5.3.9" from @ember-data/[email protected]
npm error node_modules/@ember-data/debug
npm error @ember-data/debug@"5.3.9" from [email protected]
npm error node_modules/ember-data
npm error 2 more (ember-cli-mirage, ember-data)
npm error peer @ember-data/tracking@"5.3.9" from @ember-data/[email protected]
npm error node_modules/@ember-data/store
npm error peer @ember-data/store@"5.3.9" from @ember-data/[email protected]
npm error node_modules/@ember-data/adapter
npm error @ember-data/adapter@"5.3.9" from [email protected]
npm error node_modules/ember-data
npm error 8 more (@ember-data/debug, @ember-data/graph, ...)
npm error 1 more (ember-data)
npm error 24 more (@ember/render-modifiers, @ember/test-helpers, ...)
npm error
npm error Could not resolve dependency:
npm error peer ember-source@"~3.28.1 || ^4.0.0" from @storybook/[email protected]
npm error node_modules/@storybook/ember
npm error dev @storybook/ember@"8.4.6" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/ember-source
npm error peer ember-source@"~3.28.1 || ^4.0.0" from @storybook/[email protected]
npm error node_modules/@storybook/ember
npm error dev @storybook/ember@"8.4.6" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /.npm/_logs/2025-04-04T13_21_12_397Z-eresolve-report.txt
npm error A complete log of this run can be found in: /.npm/_logs/2025-04-04T13_21_12_397Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7456ad and 01a0366.

📒 Files selected for processing (2)
  • app/components/sso-settings/index.ts (0 hunks)
  • app/services/ajax.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • app/components/sso-settings/index.ts
🧰 Additional context used
🧬 Code Definitions (1)
app/services/ajax.ts (1)
tests/unit/services/ajax-test.js (6)
  • response (27-27)
  • response (51-51)
  • response (79-79)
  • response (96-96)
  • response (130-130)
  • response (145-145)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: Run Integration Tests - Part 8
  • GitHub Check: Run Integration Tests - Part 7
  • GitHub Check: Run Integration Tests - Part 6
  • GitHub Check: Run Integration Tests - Part 5
  • GitHub Check: Run Integration Tests - Part 3
  • GitHub Check: Run Integration Tests - Part 1
  • GitHub Check: Run Linting
  • GitHub Check: Run E2E Tests (5)
  • GitHub Check: Run E2E Tests (4)
  • GitHub Check: Run E2E Tests (3)
  • GitHub Check: Run E2E Tests (2)
  • GitHub Check: Run E2E Tests (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
app/services/ajax.ts (3)

268-273: Good improvement for FormData and Blob handling.

This change correctly allows the browser to set the appropriate Content-Type header when dealing with FormData or Blob objects, rather than forcing a specific content type. For these types of data, the browser automatically sets the correct boundary and content type based on the data's content.


335-336: Type constraint enhances type safety.

Adding the extends object constraint to the generic type parameter improves type safety by ensuring that the returned type is compatible with JSON objects. This aligns well with the method's purpose of parsing JSON responses.


341-341: Type-consistent empty object return.

Casting the empty object to type T ensures type consistency when returning an empty response, which is a good practice. This makes the return type predictable regardless of whether there's content in the response.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

sonarqubecloud bot commented Apr 4, 2025

Copy link

Deploying irenestaging with  Cloudflare Pages  Cloudflare Pages

Latest commit: 01a0366
Status: ✅  Deploy successful!
Preview URL: https://5b1f48d2.irenestaging.pages.dev
Branch Preview URL: https://sso-idp-upload-fix.irenestaging.pages.dev

View logs

Copy link

cypress bot commented Apr 4, 2025

Irene    Run #635

Run Properties:  status check failed Failed #635  •  git commit 1cb4113adb ℹ️: Merge 01a0366ccdf34d80743426f9f4bd7bff90154753 into d7456add4ad246d851ba100b8170...
Project Irene
Branch Review sso-idp-upload-fix
Run status status check failed Failed #635
Run duration 07m 35s
Commit git commit 1cb4113adb ℹ️: Merge 01a0366ccdf34d80743426f9f4bd7bff90154753 into d7456add4ad246d851ba100b8170...
Committer Yibaebi Elliot
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 31
View all changes introduced in this branch ↗︎

Tests for review

Failed  cypress/tests/dynamic-scan.spec.ts • 1 failed test

View Output

Test Artifacts
Dynamic Scan > it tests dynamic scan for an ipa file: 58061 Test Replay Screenshots

@Yibaebi Yibaebi merged commit f50dad2 into develop Apr 4, 2025
35 of 37 checks passed
@future-pirate-king future-pirate-king deleted the sso-idp-upload-fix branch April 4, 2025 14:02
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