Skip to content

[Rollout] Production Rollout 2025-08-28#5215

Merged
dkurepa merged 7 commits intodotnet:productionfrom
dkurepa:rollout/2025-08-28
Aug 27, 2025
Merged

[Rollout] Production Rollout 2025-08-28#5215
dkurepa merged 7 commits intodotnet:productionfrom
dkurepa:rollout/2025-08-28

Conversation

@dkurepa
Copy link
Copy Markdown
Member

@dkurepa dkurepa commented Aug 27, 2025

premun and others added 7 commits August 26, 2025 14:40
…tion logic (dotnet#5197)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: premun <7013027+premun@users.noreply.github.com>
Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
## New Filter Types
Added 4 new filter keywords to help distinguish between different types of VMR codeflow subscriptions:
- `:ff` and `:forwardflow` - filters for forward flows (source-enabled subscriptions with target directory)
- `:bf` and `:backflow` - filters for backflows (source-enabled subscriptions with source directory)

These filters use the existing `IsForwardFlow()` and `IsBackflow()` extension methods on the `Subscription` class.

## Partial Matching Auto-completion
Enhanced the filter system to automatically expand partial filter matches when unambiguous:
- Typing `:c` automatically applies `:codeflow`
- Typing `:forward` expands to `:forwardflow`
- Typing `:back` expands to `:backflow`
- Ambiguous cases like `:f` (could match `:ff` or `:forwardflow`) don't expand
…ipProperty` dependencies (dotnet#5209)

dotnet#5150
Also removes `<?xml version="1.0" encoding="utf-8"?>` from
VersionDetails.props, because it was not needed, since it's an msbuild
file

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR implements validation to prevent misconfigured VMR codeflow
subscriptions that could lead to conflicts and operational issues, while
also improving the API design by unifying subscription querying methods.

## Problem

Currently, it's possible to create conflicting codeflow subscriptions
that can cause problems:

1. **Backflow conflicts**: Multiple VMR→repository subscriptions
targeting the same repository branch
2. **Forward flow conflicts**: Multiple repository→VMR subscriptions
flowing into the same VMR branch and target directory

These misconfigurations can lead to race conditions, merge conflicts,
and unexpected behavior in the dependency flow system.

## Solution

### Comprehensive Validation
Added validation with a shared service architecture:

- **`ICodeflowSubscriptionValidationService`**: Common interface in
`Maestro.Common`
- **`CodeflowSubscriptionValidationService`**: Single implementation
containing all validation logic
- **Server-side validation**: SubscriptionsController validates on
`Create()` and `UpdateSubscription()`
- **Client-side validation**: DARC CLI validates in
`AddSubscriptionOperation` and `UpdateSubscriptionOperation`
- **Shared base class**: `SubscriptionOperationBase` eliminates
duplication between Add/Update operations

### Validation Rules

**Backflow subscriptions** (VMR → repository, `sourceDirectory` set):
- Only one backflow subscription allowed per target repository + target
branch combination

**Forward flow subscriptions** (repository → VMR, `targetDirectory`
set):
- Only one forward flow subscription allowed per VMR repository + VMR
branch + target directory combination

### API Improvement

Replaced the specific `GetCodeflowSubscriptionsAsync` method with a more
generic `GetSubscriptionsAsync` that accepts additional optional
parameters:

```csharp
Task<IEnumerable<Subscription>> GetSubscriptionsAsync(
    string sourceRepo = null,
    string targetRepo = null,
    int? channelId = null,
    bool? sourceEnabled = null,        // New
    string sourceDirectory = null,     // New
    string targetDirectory = null);    // New
```

This provides a cleaner, more flexible API that supports both general
subscription filtering and specific codeflow validation needs without
code duplication.

## Error Messages

Clear, actionable error messages help users understand and resolve
conflicts:

```
A backflow subscription 'abc123' already exists for the same target repository and branch. 
Only one backflow subscription is allowed per target repository and branch combination.
```

## Benefits

- **Maintainable**: Validation logic exists in one place
- **Consistent**: Same validation behavior across all entry points
- **Clean API**: Generic subscription querying without method
duplication
- **No breaking changes**: Existing functionality remains unaffected

Fixes dotnet#5204.

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

✨ Let Copilot coding agent [set things up for
you](https://github.com/dotnet/arcade-services/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: premun <7013027+premun@users.noreply.github.com>
Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
@dkurepa dkurepa enabled auto-merge August 27, 2025 16:03
@dkurepa dkurepa merged commit 0fd4566 into dotnet:production Aug 27, 2025
6 of 8 checks passed
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.

4 participants