Skip to content

Use PRs when importing engine sources #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

staticlibs
Copy link
Collaborator

Currently Vendor.yml workflow imports DuckDB engine sources and commits the changes to the main branch straight away.

This PR changes this to import engine changes into a vendoring branch and create a PR on that branch. This PR triggers ODBC.yml tests runs. Additional job is added to ODBC.yml to merge the PRs on vendoring branch automatically after all tests are passed.

When the import happens and the PR on vendoring branch is still open (when previous import did not pass the tests), then the imported changes are added to the vendoring branch and the PR is closed and re-opened to trigger the ODBC.yml workflow run.

Non-default personal access token (PAT_TOKEN secret) must be used for creation or re-opening of the PR because the default token GITHUB_TOKEN is restricted to not trigger pull_request event. All other operations, besides the PR create/re-open, use the default token.

Merge is done by rebasing all vendoring commits onto main branch, thus the history of the imports should look the same (linear) as it looks now with direct pushes.

Testing: debugged this on a separate repo.

@staticlibs
Copy link
Collaborator Author

@carlopi I wonder if you can take a look at the workflow changes?

@maiadegraaf This change requires the vendoring branch to exist at the time when Vendor.yml is triggered. So when it comes to merging this PR, please create a vendoring branch (without any changes) on the main branch.

Examples of PRs created by updated Vendor.yml:

Currently `Vendor.yml` workflow imports DuckDB engine sources and
commits the changes to the `main` branch straight away.

This PR changes this to import engine changes into a `vendoring`
branch and create a PR on that branch. This PR triggers `ODBC.yml`
tests runs. Additional job is added to `ODBC.yml` to merge the PRs
on `vendoring` branch automatically after all tests are passed.

When the import happens and the PR on `vendoring` branch is still open
(when previous import did not pass the tests), then the imported
changes are added to the `vendoring` branch and the PR is closed and
re-opened to trigger the `ODBC.yml` workflow run.

Non-default personal access token (`PAT_TOKEN` secret) must be used for
creation or re-opening of the PR because the default token
`GITHUB_TOKEN` is restricted to not trigger `pull_request` event. All
other operations, besides the PR create/re-open, use the default token.

Merge is done by rebasing all `vendoring` commits onto `main` branch,
thus the history of the imports should look the same (linear) as it
looks now with direct pushes.

Testing: debugged this on a separate repo.
@staticlibs staticlibs merged commit 932dbd4 into duckdb:main Apr 22, 2025
7 checks passed
@staticlibs staticlibs deleted the vendor_prs branch April 22, 2025 10:07
staticlibs added a commit to staticlibs/duckdb-java that referenced this pull request May 5, 2025
This change brings in the logic for PR create/update on engine sources
import the same way how it is done for ODBC in duckdb/duckdb-odbc#96.
staticlibs added a commit to duckdb/duckdb-java that referenced this pull request May 5, 2025
This change brings in the logic for PR create/update on engine sources
import the same way how it is done for ODBC in duckdb/duckdb-odbc#96.
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