Skip to content

Add documentation and tests that maxBy/minBy return the first max/min element#19464

Merged
T-Gro merged 2 commits intomainfrom
copilot/aw-debug-repo-assist-failure
Mar 27, 2026
Merged

Add documentation and tests that maxBy/minBy return the first max/min element#19464
T-Gro merged 2 commits intomainfrom
copilot/aw-debug-repo-assist-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

Implements the approved but merge-conflicted changes from PR #19140. Documents the guarantee that maxBy/minBy return the first maximal/minimal element when duplicates exist, across Array, List, and Seq modules.

Documentation (array.fsi, list.fsi, seq.fsi)

  • Added <remarks> noting first-element-wins behavior for maxBy and minBy
  • Consolidated duplicate <remarks> tags in seq.fsi

Tests (ArrayModule2.fs, ListModule2.fs, SeqModule2.fs)

  • Added test cases for both maxBy and minBy verifying the first matching element is returned
// Example: 3 appears twice, first occurrence at "c" is returned
let max = Array.maxBy fst [|1, "a"; 2, "b"; 3, "c"; 2, "d"; 3, "e"; 1, "f"|]
assert (snd max = "c")
Original prompt

This section details on the original issue you should resolve

<issue_title>[aw] Repo Assist failed</issue_title>
<issue_description>### Workflow Failure

Workflow: Repo Assist
Branch: main
Run: https://github.com/dotnet/fsharp/actions/runs/23380883204
Pull Request: #19140

Action Required

Option 1: Debug using any coding agent

Use this prompt with any coding agent (GitHub Copilot, Claude, Gemini, etc.):

Debug the agentic workflow failure using https://raw.githubusercontent.com/github/gh-aw/main/debug.md

The failed workflow run is at https://github.com/dotnet/fsharp/actions/runs/23380883204

Option 2: Assign this issue to Copilot

Assign this issue to Copilot using the agentic-workflows sub-agent to automatically debug and fix the workflow failure.

Option 3: Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

[!TIP]
To stop a workflow from creating failure issues, set report-failure-as-issue: false in its frontmatter:

safe-outputs:
  report-failure-as-issue: false

Generated from Repo Assist

  • expires on Mar 28, 2026, 1:53 PM UTC

<agent_instructions>See the LATEST failure from the comment and focus on that.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

… element

Fixes the Repo Assist workflow failure for PR #19140.
Adds documentation remarks to array.fsi, list.fsi, and seq.fsi stating
that maxBy/minBy returns the first maximal/minimal element when there
are multiple equal elements. Adds corresponding tests for Array, List,
and Seq modules.

Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/c602ace4-48eb-4981-9070-8cbad6504be9
Copilot AI changed the title [WIP] Debug agentic workflow failure for Repo Assist Add documentation and tests that maxBy/minBy return the first max/min element Mar 24, 2026
Copilot AI requested a review from T-Gro March 24, 2026 10:41
@T-Gro T-Gro marked this pull request as ready for review March 24, 2026 10:45
@T-Gro T-Gro requested a review from a team as a code owner March 24, 2026 10:45
@T-Gro T-Gro requested a review from abonie March 24, 2026 10:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Mar 24, 2026
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Mar 26, 2026
@T-Gro T-Gro merged commit 63294d7 into main Mar 27, 2026
60 of 61 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Mar 27, 2026
@T-Gro T-Gro deleted the copilot/aw-debug-repo-assist-failure branch March 27, 2026 15:51
Copilot AI added a commit that referenced this pull request Mar 31, 2026
… element (#19464)

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Mar 31, 2026
… element (#19464)

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Mar 31, 2026
… element (#19464)

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[aw] Repo Assist failed

3 participants