Skip to content

[automated] Merge branch 'production' => 'main'#4248

Merged
premun merged 1 commit into
mainfrom
merge/production-to-main
Dec 16, 2024
Merged

[automated] Merge branch 'production' => 'main'#4248
premun merged 1 commit into
mainfrom
merge/production-to-main

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

I detected changes in the production branch which have not been merged yet to main. I'm a robot and am configured to help you automatically keep main up to date, so I've opened this PR.

This PR merges commits made on production by the following committers:

Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.

merge button instructions

If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.

Instructions for merging via command line

Run these commands to merge this pull request from the command line.

git fetch
git checkout production
git pull --ff-only
git checkout main
git pull --ff-only
git merge --no-ff production

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/arcade-services HEAD:merge/production-to-main
or if you are using SSH
git push [email protected]:dotnet/arcade-services HEAD:merge/production-to-main

After PR checks are complete push the branch

git push

Instructions for resolving conflicts

⚠️ If there are merge conflicts, you will need to resolve them manually before merging. You can do this using GitHub or using the command line.

Instructions for updating this pull request

Contributors to this repo have permission update this pull request by pushing to the branch 'merge/production-to-main'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.

git fetch
git checkout -b merge/production-to-main origin/main
git pull https://github.com/dotnet/arcade-services merge/production-to-main
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/arcade-services HEAD:merge/production-to-main
or if you are using SSH
git fetch
git checkout -b merge/production-to-main origin/main
git pull [email protected]:dotnet/arcade-services merge/production-to-main
(make changes)
git commit -m "Updated PR with my changes"
git push [email protected]:dotnet/arcade-services HEAD:merge/production-to-main

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

@premun premun enabled auto-merge December 16, 2024 11:25
@premun premun merged commit b14b29d into main Dec 16, 2024
@premun premun deleted the merge/production-to-main branch December 16, 2024 11:25
dkurepa added a commit that referenced this pull request Oct 8, 2025
…ed (#5348)

## Problem

When updating a subscription using `darc update-subscription` with the
popup editor, changes to immutable fields were silently ignored. The
command would report success, but fields like `TargetBranch`,
`TargetRepository`, and `SourceEnabled` would not be updated, leading to
user confusion.

As noted in the documentation, these fields cannot be modified because
of how Maestro++ tracks pull requests, but the tool was not validating
or enforcing this restriction.

**Example of the problem:**
```bash
> darc update-subscription --id 58cbbaad-a57e-4327-865a-609fa1c10968
# User changes target branch in the popup from 'main' to 'dev'
Successfully updated subscription with id '58cbbaad-a57e-4327-865a-609fa1c10968'.
# But the target branch is still 'main' - change was silently ignored
```

## Solution

Added validation in `UpdateSubscriptionOperation` after popup values are
extracted to detect and reject changes to immutable fields:
- **Target Repository URL** - The repository receiving updates
- **Target Branch** - The branch receiving updates
- **Source Enabled** - Whether the subscription uses source-enabled
(VMR) flow

When users attempt to modify any of these fields, the operation now
fails with a clear error message listing all immutable fields that were
changed.

**After this fix:**
```bash
> darc update-subscription --id 58cbbaad-a57e-4327-865a-609fa1c10968
# User changes target branch in the popup from 'main' to 'dev'
The following immutable fields cannot be modified:
  - Target Branch (cannot be changed from 'main')
```

## Changes

- **UpdateSubscriptionOperation.cs**: Added validation logic after popup
values are extracted to compare against the original subscription and
detect immutable field changes
- **Darc.md**: Updated documentation to explicitly list all immutable
fields and clarify that changes will result in an error

## Testing

- All existing tests continue to pass (117 passed, 1 skipped)
- Build succeeds with no warnings
- Documentation updated to reflect the new behavior

Fixes #4248

Fixes #4725

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>darc update-subscription target branch doesn't work but
also doesn't error</issue_title>
> <issue_description>If I update a subscription's target branch, darc
tells me that it successfully updated the subscription but the change is
not respected:
> 
> > C:\git\arcade-services\tools\FlatFlowMigrationCli>darc
update-subscription --id 58cbbaad-a57e-4327-865a-609fa1c10968
> Successfully updated subscription with id
'58cbbaad-a57e-4327-865a-609fa1c10968'.
> 
> If we can't update target branches, we should at least error out
during the save.</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@dkurepa</author><body>
> @ViktorHofer when this happened, did you use the `update-subscription`
with the pop-up? </body></comment_new>
> <comment_new><author>@ViktorHofer</author><body>
> Yes. Pop-up in notepad on Windows.</body></comment_new>
> <comment_new><author>@dkurepa</author><body>
> Ah I see, thanks</body></comment_new>
> <comment_new><author>@dkurepa</author><body>
> The best thing to do here is probably to error out.
> Ideally we wouldn't do this just for the target branch, but for other
non mutable fields:
>  - Id
>  - targetRepository
>  - target branch
>  - source enabled
> 
> So after a popup is closed, we'd check if any of these are changed,
and error out with all of them</body></comment_new>
> </comments>
> 


</details>
Fixes #4725

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: dkurepa <[email protected]>
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.

1 participant