Skip to content

Commit 6b2c2ca

Browse files
committed
Introduce Github agentic workflow to sync to latest EF daily build
1 parent b6a1b25 commit 6b2c2ca

File tree

7 files changed

+1297
-0
lines changed

7 files changed

+1297
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
*.txt text=auto
99

1010
packages/ binary
11+
12+
.github/workflows/*.lock.yml linguist-generated=true merge=ours
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: EF Latest Version Syncer
3+
description: Updates EFCore.PG to reference the latest EF daily build, and makes any necessary adjustments to make it pass.
4+
---
5+
6+
# Synchronize to latest EF
7+
8+
We're going to sync the EF Core PostgreSQL provider (EFCore.PG) in this repo to reference the latest daily build of EF Core, and make any necessary adjustment. Try your best to arrive at a fully 100% passing build after syncing, but even if you're unable to do so, submit a PR with whatever you did manage to do, as a basic for further manual work.
9+
10+
## 1. Find out and depend on the latest EF Core daily build of the current preview release
11+
12+
1. First, check what the latest *released* preview/rc of EF on nuget.org.
13+
2. Then, find the latest EF Core daily build version **for the upcoming preview/RC**; we do not want to sync to a daily build that's for the next preview. For example, if the current released EF preview is preview.3, we want to update to the latest daily build for preview.4, and not to preview.5 even if packages already exist for that.
14+
3. Note that after preview.7, the naming switches to rc.1 and rc.2.
15+
4. Once you've found the latest daily build package we're syncing to, update the EF Core version in Directory.Packages.props to use it. The EF Core daily build nuget feed is https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json (note that you may need to update dotnet11 to dotnet12 depending on the version we're looking for).
16+
5. There's no need to switch to the latest daily build of the dotnet SDK though - only of EF; please just always use the latest released preview version of the dotnet SDK (not daily build), unless there's a specific issue requiring the very latest SDK (very rare/unlikely).
17+
18+
## 2. Build
19+
20+
Build EFCore.PG and resolve any errors that are reported.
21+
22+
The EF Core source code can be found in https://github.com/dotnet/efcore - you can explore that repo to understand what changes happened there from the last version the EFCore.PG used to the version we're upgrading towards. Focus especially on changes that occured before the current daily build referenced by EFCore.PG (before your change), since everything is still working correctly with it.
23+
24+
Generally try to align EFCore.PG to whatever practices and patterns are in use within EF Core itself.
25+
26+
## 3. Run Tests
27+
28+
Once everything builds, run the tests to discover additional failing scenarios.
29+
30+
* If you get failures from Check_all_tests_overridden, that means that new tests have been added - or possibly that existing ones have been renamed. Find out if a rename occurred by finding missing overridden tests that resemble the new test, and explore the EF code base (including its git history) as needed.
31+
* When adding new test overrides, add them in the appropriate place in the source file, following their placement in the base class. Do not simply add them at the end of the file.
32+
* Also, always add AssertSql(), following the pattern for other tests in the class.
33+
* If you get failures from test NpgsqlComplianceTest.All_test_bases_must_be_implemented, that means that new test base classes have been added - or possibly that existing ones have been renamed. Find out if a rename occurred by finding missing base classes that resemble the new base class, and explore the EF code base (including its git history) as needed. Do not simply add the missing test suite to IgnoredTestBases.
34+
35+
## 4. Commit and submit PR
36+
37+
* Commit all changes in a single commit (no need for separate commits), calling it simply "Sync to EF 11.0.0-preview.1.26104.118" (substituting the actual version). No need for a commit body message.
38+
* Create a PR in https://github.com/npgsql/efcore.pg with all the changes.
39+
* Once again, even if you've failed to arrive at a 100% passing build, submit whatever work you did do as a basis for further manual work.

.github/aw/actions-lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"entries": {
3+
"actions/github-script@v8": {
4+
"repo": "actions/github-script",
5+
"version": "v8",
6+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"github/gh-aw/actions/setup@v0.44.0": {
9+
"repo": "github/gh-aw/actions/setup",
10+
"version": "v0.44.0",
11+
"sha": "cec1ecf3b97e9a1bbffaedf490a49ce03c1071ba"
12+
}
13+
}
14+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#
2+
# ___ _ _
3+
# / _ \ | | (_)
4+
# | |_| | __ _ ___ _ __ | |_ _ ___
5+
# | _ |/ _` |/ _ \ '_ \| __| |/ __|
6+
# | | | | (_| | __/ | | | |_| | (__
7+
# \_| |_/\__, |\___|_| |_|\__|_|\___|
8+
# __/ |
9+
# _ _ |___/
10+
# | | | | / _| |
11+
# | | | | ___ _ __ _ __| |_| | _____ ____
12+
# | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
13+
# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
14+
# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
15+
#
16+
# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.44.0). DO NOT EDIT.
17+
#
18+
# To regenerate this workflow, run:
19+
# gh aw compile
20+
# Not all edits will cause changes to this file.
21+
#
22+
# For more information: https://github.github.com/gh-aw/introduction/overview/
23+
#
24+
# Alternative regeneration methods:
25+
# make recompile
26+
#
27+
# Or use the gh-aw CLI directly:
28+
# ./gh-aw compile --validate --verbose
29+
#
30+
# The workflow is generated when any workflow uses the 'expires' field
31+
# in create-discussions, create-issues, or create-pull-request safe-outputs configuration.
32+
# Schedule frequency is automatically determined by the shortest expiration time.
33+
#
34+
name: Agentic Maintenance
35+
36+
on:
37+
schedule:
38+
- cron: "37 0 * * *" # Daily (based on minimum expires: 7 days)
39+
workflow_dispatch:
40+
41+
permissions: {}
42+
43+
jobs:
44+
close-expired-entities:
45+
runs-on: ubuntu-slim
46+
permissions:
47+
discussions: write
48+
issues: write
49+
pull-requests: write
50+
steps:
51+
- name: Setup Scripts
52+
uses: github/gh-aw/actions/setup@v0.44.0
53+
with:
54+
destination: /opt/gh-aw/actions
55+
56+
- name: Close expired discussions
57+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
58+
with:
59+
script: |
60+
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
61+
setupGlobals(core, github, context, exec, io);
62+
const { main } = require('/opt/gh-aw/actions/close_expired_discussions.cjs');
63+
await main();
64+
65+
- name: Close expired issues
66+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
67+
with:
68+
script: |
69+
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
70+
setupGlobals(core, github, context, exec, io);
71+
const { main } = require('/opt/gh-aw/actions/close_expired_issues.cjs');
72+
await main();
73+
74+
- name: Close expired pull requests
75+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
76+
with:
77+
script: |
78+
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
79+
setupGlobals(core, github, context, exec, io);
80+
const { main } = require('/opt/gh-aw/actions/close_expired_pull_requests.cjs');
81+
await main();

0 commit comments

Comments
 (0)