-
Notifications
You must be signed in to change notification settings - Fork 22
CC-1755: Add export functionality for viewing community solutions on GitHub #2906
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
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
…tageSolutionModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Adapter Usage Causes URL Generation Issues
The markExportAsAccessed
method in CommunityCourseStageSolutionModel
manually constructs the API URL for marking an export as accessed. It incorrectly uses the 'application' adapter instead of the 'community-solution-export' adapter, bypassing the adapter's URL building methods (e.g., urlForUpdateRecord
). This results in inconsistent URL generation and potential breakage if API paths or host configurations change.
app/models/community-course-stage-solution.ts#L124-L129
frontend/app/models/community-course-stage-solution.ts
Lines 124 to 129 in 04b2e6d
@action | |
async markExportAsAccessed(exportModel: CommunitySolutionExportModel): Promise<void> { | |
// @ts-ignore | |
const adapter: JSONAPIAdapter = this.store.adapterFor('application'); | |
await adapter.ajax(`${adapter.host}/api/v1/community-solution-exports/${exportModel.id}/mark-as-accessed`, 'POST'); |
Bug: GitHub URL Construction Fails Without Base URL Check
After an existing community solution export finishes provisioning, the code checks if the export is isProvisioned
but fails to verify the existence of baseUrl
before constructing the GitHub URL. This can lead to a malformed URL or a runtime error if baseUrl
is missing. This behavior is inconsistent with other baseUrl
checks within the same method and related components.
app/components/course-page/course-stage-step/community-solution-card/highlighted-file-card.ts#L123-L127
Lines 123 to 127 in 04b2e6d
if (currentExport.isProvisioned) { | |
await solution.markExportAsAccessed(currentExport); | |
const url = `${currentExport.baseUrl}/${this.args.highlightedFile.filename}`; | |
window.open(url, '_blank', 'noopener,noreferrer'); |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Bundle ReportChanges will increase total bundle size by 7.87kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: client-array-pushAssets Changed:
Files in
|
This PR adds the ability to view community solutions on GitHub by creating temporary exports when solutions aren't already published to public repositories.
Checklist:
[percy]
in the message to trigger)