Skip to content

feat: support v2 sync protocol#4634

Draft
doc-han wants to merge 3 commits intomainfrom
sync-v2-protocol
Draft

feat: support v2 sync protocol#4634
doc-han wants to merge 3 commits intomainfrom
sync-v2-protocol

Conversation

@doc-han
Copy link
Copy Markdown
Contributor

@doc-han doc-han commented Apr 17, 2026

Description

This PR makes sync v2 protocol the default for syncing projects with Github. It still allows users to fallback to the old config.json style by explicitly enabling it.

Currently defaults to v2 but can be switched to v1 style
Screenshot 2026-04-17 at 9 03 49 AM

Closes #4523

Validation steps

  1. Try to sync a project with github
  2. You'll notice the default will push an openfn.yaml instead of openfn-<project-id>-config.json
  3. Do an actual push to github
  4. Check whether your openfn.yaml is in github with nicely generated content like the example below

Example openfn.yaml content

project:
  uuid: 43c34b65-50cf-4ec3-b480-32b3b17ac9c0
  endpoint: http://localhost:4000
  alias: 
  inserted_at: 2026-04-13T01:00:00Z
  updated_at: 2026-04-13T04:37:54Z
  id: sync
  name: sync
workspace:
  credentials: credentials.yaml
  dirs:
    projects: .projects
    workflows: workflows
  formats:
    openfn: yaml
    project: yaml
    workflow: yaml

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation bot moved this to New Issues in Core Apr 17, 2026
@doc-han
Copy link
Copy Markdown
Contributor Author

doc-han commented Apr 17, 2026

Problems

  1. Why don't we allow users to generate a new github project from our platform when doing sync? (because if I need it on a new repo, I'll have to manually create that on github)
  2. When a repo has no content yet. We're unable to find the branches on it. i.e we can't find main on the repo

@doc-han
Copy link
Copy Markdown
Contributor Author

doc-han commented Apr 17, 2026

@josephjclark suggests we keep v1 as default and then allow users to switch to v2 style

<.icon
name="hero-chevron-right-mini"
class="h-4 w-4 transition-transform group-open:rotate-90"
/> Advanced: use legacy JSON config format
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice idea, and we need to bank it because when we make v2 the default, this is probably how we'll want to handle it.

But for now we actually want to leave v1 the default until v2 has had a bit more testing.

def config_path(repo_connection) do
repo_connection.config_path ||
"./openfn-#{repo_connection.project_id}-config.json"
if repo_connection.use_legacy_config do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling v1 "legacy" internally is still the correct thing to do though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Update GH sync to support v2 protocol

2 participants