snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
Atlas CI Public / lint (push) Failing after 13s
Atlas CI Public / sync (push) Has been skipped

This commit is contained in:
upstream-mirror
2026-09-15 22:12:36 +05:00
commit 4b3ad0b611
2680 changed files with 719472 additions and 0 deletions

58
.github/ISSUE_TEMPLATE/1.bug.md vendored Normal file
View File

@@ -0,0 +1,58 @@
---
name: Bug report 🐛
about: Create a bug report.
labels: 'status: needs triage'
---
<!-- Provide a general summary of the issue in the Title above -->
<!--
Thank you very much for contributing to Ent by creating an issue! ❤️
To avoid duplicate issues we ask you to check off the following list.
-->
<!-- Checked checkbox should look like this: [x] -->
- [ ] The issue is present in the latest release.
- [ ] I have searched the [issues](https://github.com/ent/ent/issues) of this repository and believe that this is not a duplicate.
## Current Behavior 😯
<!-- Describe what happens instead of the expected behavior. -->
## Expected Behavior 🤔
<!-- Describe what should happen. -->
## Steps to Reproduce 🕹
<!--
Are you able to reproduce this bug? If so, follow the steps in the ent/bug repository: https://github.com/ent/bug
After you are done, paste the link to your new repository here (make sure it's public)!
(In this case, you can disregard filling out the steps below)
-->
<!--
TODO: reproduction repo
-->
Steps:
1.
2.
3.
4.
## Your Environment 🌎
<!--
Include as many relevant details about the environment with which you experienced the bug.
-->
| Tech | Version |
| ----------- | ------- |
| Go | 1.17.? |
| Ent | 0.9.? |
| Database | MySQL |
| Driver | https://github.com/go-sql-driver/mysql |

27
.github/ISSUE_TEMPLATE/2.feature.md vendored Normal file
View File

@@ -0,0 +1,27 @@
---
name: Feature request 🎉
about: Suggest a new idea for the project.
labels: 'status: needs triage'
---
<!-- Provide a general summary of the feature in the Title above -->
<!--
Thank you very much for contributing to Ent by creating an issue! ❤️
To avoid duplicate issues we ask you to check off the following list.
-->
<!-- Checked checkbox should look like this: [x] -->
- [ ] I have searched the [issues](https://github.com/ent/ent/issues) of this repository and believe that this is not a duplicate.
## Summary 💡
<!-- Describe how it should work. -->
## Motivation 🔦
<!--
What are you trying to accomplish? How has the lack of this feature affected you?
Providing context helps us come up with a solution that is most useful in the real world.
-->

5
.github/ISSUE_TEMPLATE/3.support.md vendored Normal file
View File

@@ -0,0 +1,5 @@
---
name: Question
about: General support
labels: 'status: needs triage'
---

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false # force the usage of a template
contact_links:
- name: Something Else ❔
url: https://gophers.slack.com/archives/C01FMSQDT53
about: Come chat to us in the gophers slack

10
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: gomod
directory: /
schedule:
interval: daily

57
.github/workflows/atlas-ci-public.yaml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Atlas CI Public
on:
# Run whenever code is changed in the master branch,
# change this to your root branch.
push:
branches:
- master
paths:
- 'examples/migration/ent/migrate/migrations/*'
pull_request:
paths:
- 'examples/migration/ent/migrate/migrations/*'
jobs:
sync:
permissions:
contents: read
id-token: write
needs: lint
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ariga/atlas-sync-action@v0
with:
dir: 'examples/migration/ent/migrate/migrations'
driver: mysql # or: postgres | sqlite
cloud-public: true
lint:
permissions:
contents: read
id-token: write
pull-requests: write
services:
# Spin up a mysql:8.0.29 container to be used as the dev-database for analysis.
mysql:
image: mysql:8.0.29
env:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: dev
ports:
- "3306:3306"
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Mandatory unless "latest" is set below.
- uses: ariga/atlas-action@v0
with:
dir: 'examples/migration/ent/migrate/migrations'
dev-url: mysql://root:pass@localhost:3306/dev
cloud-public: true

501
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,501 @@
name: Continuous Integration
on:
push:
paths-ignore:
- 'doc/**'
tags-ignore:
- '*.*'
pull_request:
paths-ignore:
- 'doc/**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Run linters
uses: golangci/golangci-lint-action@v5
with:
args: --verbose
unit:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.23', '1.24']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run cmd tests
run: go test -race ./...
working-directory: cmd
- name: Run dialect tests
run: go test -race ./...
working-directory: dialect
- name: Run schema tests
run: go test -race ./...
working-directory: schema
- name: Run loader tests
run: go test -race ./...
working-directory: entc/load
- name: Run codegen tests
run: go test -race ./...
working-directory: entc/gen
- name: Run example tests
working-directory: examples
run: go test -race ./...
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run go generate
run: go generate ./... && go mod tidy
- name: Run go generate on examples directory
working-directory: examples
run: go generate ./... && go mod tidy
- name: Run go generate on integration directory
working-directory: entc/integration
run: go generate ./... && go mod tidy
- name: Check generated files
run: |
status=$(git status --porcelain)
if [ -n "$status" ]; then
echo "you need to run 'go generate ./...' in root and 'examples' dirs and commit the changes"
echo "$status"
git --no-pager diff
exit 1
fi
integration:
runs-on: ubuntu-latest
services:
mysql56:
image: mysql:5.6.35
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
mysql57:
image: mysql:5.7.26
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 3307:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
mysql8:
image: mysql:8
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 3308:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
maria:
image: mariadb:10.4 # Temporary to unblock PRs from failing.
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 4306:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
maria102:
image: mariadb:10.2.32
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 4307:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
maria103:
image: mariadb:10.3.13
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 4308:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
postgres10:
image: postgres:10
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5430:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres11:
image: postgres:11
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5431:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres12:
image: postgres:12.3
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres13:
image: postgres:13.1
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres14:
image: postgres:14
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5434:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres15:
image: postgres:15
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5435:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres16:
image: postgres:16
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5436:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres17:
image: postgres:17
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5437:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
gremlin-server:
image: entgo/gremlin-server
ports:
- 8182:8182
options: >-
--health-cmd "netstat -an | grep -q 8182"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run integration tests
working-directory: entc/integration
run: go test -race -count=2 ./...
migration:
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/master' }}
services:
mysql56:
image: mysql:5.6.35
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
mysql57:
image: mysql:5.7.26
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 3307:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
mysql8:
image: mysql:8
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 3308:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
maria:
image: mariadb:10.4 # Temporary to unblock PRs from failing.
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 4306:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
maria102:
image: mariadb:10.2.32
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 4307:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
maria103:
image: mariadb:10.3.13
env:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
ports:
- 4308:3306
options: >-
--health-cmd "mysqladmin ping -ppass"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
postgres10:
image: postgres:10
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5430:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres11:
image: postgres:11
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5431:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres12:
image: postgres:12.3
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres13:
image: postgres:13.1
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres14:
image: postgres:14
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5434:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres15:
image: postgres:15
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5435:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres16:
image: postgres:16
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5436:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres17:
image: postgres:17
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: pass
ports:
- 5437:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
gremlin-server:
image: entgo/gremlin-server
ports:
- 8182:8182
options: >-
--health-cmd "netstat -an | grep -q 8182"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout origin/master
run: git checkout origin/master
- name: Run integration on origin/master
working-directory: entc/integration
run: go test -race -count=2 ./...
- name: Checkout previous HEAD
run: git checkout -
- name: Run integration on HEAD
working-directory: entc/integration
run: go test -race -count=2 ./...