Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 24, 2025

File Upload URL Configuration Fix ✅

Successfully resolved merge conflicts after retargeting PR to the "next" branch. The implementation now correctly applies to the next branch structure with all functionality preserved.

Implementation Complete ✅

  • Analyze the issue and understand the problem
  • Create a method to derive upload endpoint from update endpoint
  • Modify generateSignedUploadURL() to use the configured endpoint
  • Add tests to verify the fix works correctly
  • Add comprehensive tests for edge cases
  • Resolve merge conflicts after retargeting to next branch ✅

Conflict Resolution

The conflicts arose because the "next" branch had a different structure than "development":

  • generateSignedUploadURL() was at different line numbers (531-541 vs 446-456)
  • getUpdateEndpoint() was at different line numbers (614-617 vs 529-532)

Resolution applied:

  • Added getUploadEndpoint() method at line 624 after getUpdateEndpoint()
  • Updated generateSignedUploadURL() at line 540 to use getUploadEndpoint()
  • Preserved all existing tests and added new comprehensive tests

Changes Made for Next Branch

1. Added getUploadEndpoint() method at line 624 in CBWIREController.cfc

function getUploadEndpoint() {
    var updateEndpoint = getUpdateEndpoint();
    // Replace "/update" with "/upload" in the endpoint
    return updateEndpoint.replace("/update", "/upload");
}

2. Updated generateSignedUploadURL() method at line 540

Before: Hardcoded /cbwire/upload

return local.baseURL & "/cbwire/upload?expires=" & local.expires & "&signature=" & urlEncodedFormat( local.signature );

After: Uses configured endpoint

return local.baseURL & getUploadEndpoint() & "?expires=" & local.expires & "&signature=" & urlEncodedFormat( local.signature );

3. Added comprehensive tests in CBWIRESpec.cfc

  • 5 new tests for upload endpoint functionality
  • 1 integration test for actual upload URL generation with custom endpoint
  • Proper cleanup to avoid test interference

Problem Solved ✅

Root Issue: generateSignedUploadURL() hardcoded /cbwire/upload regardless of updateEndpoint configuration

Solution: Now properly derives upload endpoint from the configured update endpoint setting

Example Behavior:

  • updateEndpoint = "/index.bxm/cbwire/update"uploadEndpoint = "/index.bxm/cbwire/upload"
  • Default: updateEndpoint = "/cbwire/update"uploadEndpoint = "/cbwire/upload"

Conflicts resolved and implementation is minimal, surgical, and precise - exactly what was needed to fix the specific issue without disrupting existing functionality.

Fixes #207.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

grantcopley and others added 6 commits June 27, 2025 11:29
Bumps [elpete/setup-commandbox](https://github.com/elpete/setup-commandbox) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/elpete/setup-commandbox/releases)
- [Commits](elpete/setup-commandbox@v1.0.0...v1.0.1)

---
updated-dependencies:
- dependency-name: elpete/setup-commandbox
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…s/elpete/setup-commandbox-1.0.1

Bump elpete/setup-commandbox from 1.0.0 to 1.0.1
Copy link
Contributor Author

Copilot AI commented Sep 24, 2025

@grantcopley 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@grantcopley grantcopley marked this pull request as ready for review September 24, 2025 06:42
@github-actions
Copy link

github-actions bot commented Sep 24, 2025

adobe@2018 Test Results

157 tests   144 ✔️  3s ⏱️
    2 suites    13 💤
    1 files        0

Results for commit 5b0d965.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 24, 2025

lucee@5 Test Results

157 tests  +6   144 ✔️ +6   2s ⏱️ ±0s
    2 suites ±0     13 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 5b0d965. ± Comparison against base commit c4e15e4.

♻️ This comment has been updated with latest results.

Copilot AI and others added 2 commits September 24, 2025 06:47
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
Copilot AI changed the title [WIP] File uploads do not honor the setting set in the 'updateEndpoint' configuration setting. Fix file upload URLs to honor updateEndpoint configuration Sep 24, 2025
Copilot AI requested a review from grantcopley September 24, 2025 06:51
@grantcopley
Copy link
Collaborator

@copilot we need to target this PR to the next branch not development

Copy link
Contributor Author

Copilot AI commented Sep 24, 2025

@copilot we need to target this PR to the next branch not development

I understand you want to target the "next" branch instead of "development". Since this is a PR targeting change rather than a code change, you'll need to update the base branch in the GitHub UI:

  1. Go to the PR page on GitHub
  2. Click "Edit" next to the base branch (currently showing "development")
  3. Select "next" as the new base branch
  4. GitHub will automatically update the PR to compare against the "next" branch

If there are any merge conflicts after changing the base branch, I can help resolve those once the retargeting is complete.

Copilot AI requested a review from grantcopley September 24, 2025 06:58
@grantcopley grantcopley changed the base branch from development to next September 24, 2025 06:58
@grantcopley
Copy link
Collaborator

@copilot we have conflicts

Co-authored-by: grantcopley <1197835+grantcopley@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 24, 2025

@copilot we have conflicts

Conflicts resolved! I've rebased the changes onto the "next" branch structure. The implementation maintains the same functionality:

  1. Added getUploadEndpoint() method at line 624 that derives upload endpoints from the configured updateEndpoint
  2. Updated generateSignedUploadURL() at line 540 to use the derived endpoint instead of hardcoded /cbwire/upload
  3. Preserved all existing tests and added comprehensive new tests

The fix now works correctly with the next branch structure. Commit: 5ecf734

@grantcopley grantcopley deleted the copilot/fix-207 branch September 24, 2025 17:26
@grantcopley grantcopley added this to the v5.0 milestone Oct 9, 2025
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.

File uploads do not honor the setting set in the 'updateEndpoint' configuration setting.

2 participants