You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This procedure details how to fork a new version of the core EDC and migrate the changes of the previous version to that new version.
This procedure was updated for the last time for the 0.7.2 fork.
Keep in mind that any new EDC version comes with novelties and that this procedure may need adjustments.
Work Breakdown
As a general rule, look at the early diffs of the previous forks to see what was added of removed.
In this procedure, we will work with the following repositories
This will hide all the intermediate commits and show only the one that are key to understand the repo's tree structure: tags, branches with author, date, hash.
This procedure uses templates for the version.
It is advised to replace all the template strings with the version that you want to migrate for more clarity
Identify the versions that you migrate
NEXT is the upstream version that you want to fork from. e.g 0.7.2
N1 is 0
N2 is 7
N3 is 2
PREVIOUS is the version that you will copy the fork changes from. e.g. 0.2.1.4
P1 is 0
P2 is 2
P3 is 1
P4 is 4
Replace the placeholders with the correct numbers
sed --in-place 's/N1/0/g; s/N2/7/g; s/N3/2/g; s/P1/0/g; s/P2/2/g; s/P3/1/g; s/P4/4/g' fork.md
Let's fork!
Set up
Each version that needs forking has its own branch in the sovity fork.
Here we have an old fork that we want to get the features from named vP1.P2.P3.x and a new fork named vN1.N2.N3.x into which we want to port the changes made in vP1.P2.P3.x up to vP1.P2.P3.P4
Note: the branch names here are to be seen as references, so they should really be remotes/....
# ... are comments to describe the situation and no part of the output.
remotes/fork/default # the replacement for upstream/main use in the sovity fork
remotes/fork/main # not used in the fork, deplaced by main
remotes/fork/sovity/O12.O3 # the previous fork branch
remotes/upstream/bugfix/N1.N2.N3 # the branch we want to work
... more # and many other branches
git tag -l
The output will vary based on the version that have already been forked. Here is the output where 0.2.1 exists and 0.7.2 will be forked.
# ... are comments to describe the situation and no part of the output.
v0.2.1 # the upstream previously forked version
v0.2.1.2 # v0.2.1.1 is missing because it was never published correctly and was replaced by 0.2.1.2
v0.2.1.3
v0.2.1.4 # the latest sovity fork version of v0.2.1
v0.7.2 # the version we want to fork
... more
Establish the branches
In the fork, find the tag vN1.N2.N3 of the branch that you want to fork from.
Create a new branch sovity/N1.N2.N3 from that tag.
git checkout -b sovity/N1.N2.N3 vN1.N2.N3
Push this branch to the fork. It will be our new main for this fork version.
git push fork sovity/N1.N2.N3:sovity/N1.N2.N3
Checkout a new branch N1.N2.N3-fork-setup on the same commit as sovity/N1.N2.N3.x.
git checkout sovity/N1.N2.N3
git checkout -b N1.N2.N3-fork-setup
In gradle.properties, set the correct branch version: N1.N2.N3.1.
git remote show fork
* remote fork
Fetch URL: [email protected]:sovity/core-edc.git
Push URL: [email protected]:sovity/core-edc.git
HEAD branch: doesntMatter
Remote branches:
sovity/P1.P2.P3 tracked
sovity/N1.N2.N3 tracked
... more
Local branches configured for 'git pull':
sovity/N1.N2.N3 merges with remote sovity/N1.N2.N3
... more
Local refs configured for 'git push':
sovity/N1.N2.N3 pushes to sovity/N1.N2.N3 (up to date)
... more
Update the project
Before editing the code, check that your IDE has the correct editor settings (imports single classes, indents, ...). There is an editorconfig file in the project.
Run the tests locally and check that they all work. If not:
Try to fix the test if it's relevant for the changes that we want to do in the fork.
Consider adding @Disabled on the tests that we will likely not use or that would be hard to fix.
e.g. outdated certificates would be hard to regenerate and fix and could be disabled as long as our fork doesn't touch the parts of the code that use them.
Add a changelog CHANGELOG.md and the docs docs/developer/fork/* from the previous version P1.P2.P3.P4
Remove the previous releases from the CHANGELOG.md and keep the template.
Add a new doc file docs/developer/fork/vN1.N2.N3.X.md
For each of the former change in the CHANGELOG.md
Evaluate whether the change needs to be ported
Reasons for not porting may include
The code that the fork used no longer exist
The change or an equivalent was implemented upstream in a version before or including N1.N2.N3.
The change is no longer desired
...
Port the change if needed
You may try to git cherry-pick the changes from the previous fork one by one and resolve conflicts.
You may try a diff+apply+merge between the commits of the previous fork may be enough to port the change
git apply <(git diff vP1.P2... vP1.P2...)
Document the change in the CHANGELOG.md.
Detail the change in the current documentation docs/developer/fork/vN1.N2.N3.X.md. Check out the previous fork documentation for how to structure the document.
Implement the new changes that apply to this fork.
Make it work in the CI
Find the correct GitHub action.
The EDC, as of 0.7.x, uses actions that are located in a separate repository. That repository is forked.
Because the EDC used the @main version in its CI, it is certain that the scripts that are the current @main ones were not the ones that were originally used for the Eclipse EDC release you're forking, and it is likely that the current scripts will fail, be renamed, have a different behaviour, ...
In a best-effort attempt to restore the CI, we need to pin the versions that were used and maybe update them to work on the current GitHub.
If we pin down the old version, a lot of updates may be needed.
If we pin down the new version, scripts may be missing.
The strategy here is to pin down the latest from main and fix the missing scripts individually and later update them.
The naming scheme for the tagged and updated actions is fork version _ date at which the action was working _ -version
e.g. N1.N2.N3_2025-06-07_1 for the latest main commit.
e.g. N1.N2.N3_2022.03.04_3 for the commit that was used during releasing, 3rd revision. Here the _3 is related to the actionsfork scripts and is independent of the 4th digit in the core-edcfork.
You will need potentially many revisions as you will need to push the tag each time you make a change to let the CI use that version, then retry if it failed.
This was tested to work quite well in version 0.7.2 and is detail below.
For the cases that can't be covered with the best effort approach, a fork strategy is detailed below,
see Lost action
If you need more than 1 branch for a single date, be creative in the name, either use DATE+TIME or DATE+suffix. In any case, that scenario is unlikely to happen.
Finding LATEST and LASTOK
LATEST is the last commit on the mainupstream branch.
Replace LATEST in this file by the date you find. The date part should be enough.
git show --no-patch --format=%ci upstream/main
sed --in-place 's/LATEST/2025-06-07/g' fork.md
LASTOK is optional and will be defined later.
Pin the action versions
Pin the latest version
Create a branch to track the LATESTmain commit from upstream
git checkout upstream/main
git checkout -b pinned/N1.N2.N3_LATEST
Push the branch to the fork
git push fork
Tag the latest commit in the action set with the label core edc fork branch _ today _ 1
git tag N1.N2.N3_LATEST_1 pinned/N1.N2.N3_LATEST
Push that new tag to the sovity core edc github fork
git push fork tag N1.N2.N3_LATEST_1
Change all the action's @main version for the N1.N2.N3_LATEST_1 version
Change all the eclipse-edc/.github for sovity/core-edc-github
New Fork
This procedure details how to fork a new version of the core EDC and migrate the changes of the previous version to that new version.
This procedure was updated for the last time for the 0.7.2 fork.
Keep in mind that any new EDC version comes with novelties and that this procedure may need adjustments.
Work Breakdown
As a general rule, look at the early diffs of the previous forks to see what was added of removed.
In this procedure, we will work with the following repositories
Steps
Bonus
Helpful git commands.
Find the common ancestor
For instance to know from which commit on the main branch a pinned version comes from.
git merge-base A B
finds the last common commit between the referencesA
andB
.Show a colored simplified graph
This will hide all the intermediate commits and show only the one that are key to understand the repo's tree structure: tags, branches with author, date, hash.
git log --graph --simplify-by-decoration --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
Interactive git
https://jonas.github.io/tig/
Configuration
This procedure uses templates for the version.
It is advised to replace all the template strings with the version that you want to migrate for more clarity
NEXT
is theupstream
version that you want to fork from. e.g 0.7.2N1
is0
N2
is7
N3
is2
PREVIOUS
is the version that you will copy the fork changes from. e.g. 0.2.1.4P1
is0
P2
is2
P3
is1
P4
is4
sed --in-place 's/N1/0/g; s/N2/7/g; s/N3/2/g; s/P1/0/g; s/P2/2/g; s/P3/1/g; s/P4/4/g' fork.md
Let's fork!
Set up
Each version that needs forking has its own branch in the sovity fork.
Here we have an old fork that we want to get the features from named
vP1.P2.P3.x
and a new fork namedvN1.N2.N3.x
into which we want to port the changes made invP1.P2.P3.x
up tovP1.P2.P3.P4
Note: the branch names here are to be seen as references, so they should really be
remotes/...
.Important
Note: the upstream branch name may vary:
remotes/upstream/release/0.10.0
remotes/upstream/bugfix/0.7.2
remotes/upstream/v0.6.5
Make it work locally
This section describes the steps to prepare the fork and make it run locally.
Setup a repository
fork
core-edc
git clone --origin fork [email protected]:sovity/core-edc.git
git remote add upstream [email protected]:eclipse-edc/Connector.git
git fetch --all --tags
Setup example
Your repository now looks like this:
git remote -v
git branch -a
# ...
are comments to describe the situation and no part of the output.git tag -l
The output will vary based on the version that have already been forked. Here is the output where 0.2.1 exists and 0.7.2 will be forked.
# ...
are comments to describe the situation and no part of the output.Establish the branches
vN1.N2.N3
of the branch that you want to fork from.sovity/N1.N2.N3
from that tag.git checkout -b sovity/N1.N2.N3 vN1.N2.N3
main
for this fork version.git push fork sovity/N1.N2.N3:sovity/N1.N2.N3
N1.N2.N3-fork-setup
on the same commit assovity/N1.N2.N3.x
.git checkout sovity/N1.N2.N3
git checkout -b N1.N2.N3-fork-setup
gradle.properties
, set the correct branch version:N1.N2.N3.1
.git remote show fork
Update the project
editorconfig
file in the project.@Disabled
on the tests that we will likely not use or that would be hard to fix.CHANGELOG.md
and the docsdocs/developer/fork/*
from the previous versionP1.P2.P3.P4
git checkout P1.P2.P3.P4 -- CHANGELOG.md docs/developer/fork/\*
CHANGELOG.md
and keep the template.docs/developer/fork/vN1.N2.N3.X.md
CHANGELOG.md
N1.N2.N3
.git cherry-pick
the changes from the previous fork one by one and resolve conflicts.git apply <(git diff vP1.P2... vP1.P2...)
CHANGELOG.md
.docs/developer/fork/vN1.N2.N3.X.md
. Check out the previous fork documentation for how to structure the document.Make it work in the CI
Find the correct GitHub action.
The EDC, as of
0.7.x
, uses actions that are located in a separate repository. That repository is forked.Because the EDC used the
@main
version in its CI, it is certain that the scripts that are the current@main
ones were not the ones that were originally used for the Eclipse EDC release you're forking, and it is likely that the current scripts will fail, be renamed, have a different behaviour, ...In a best-effort attempt to restore the CI, we need to pin the versions that were used and maybe update them to work on the current GitHub.
If we pin down the old version, a lot of updates may be needed.
If we pin down the new version, scripts may be missing.
The strategy here is to pin down the latest from main and fix the missing scripts individually and later update them.
Set up a repository
fork
actions
repositorygit clone --origin fork [email protected]:sovity/core-edc-github.git
upstream
actions
repositorygit remote add upstream [email protected]:eclipse-edc/.github.git
git fetch --all --tags
Result
git remote -v
Overview
Here is the example forking scenario.
LATEST
andLASTOK
are iso datesYYYY-MM-DD
The naming scheme for the tagged and updated actions is
fork version
_date at which the action was working
_-version
e.g.
N1.N2.N3_2025-06-07_1
for the latest main commit.e.g.
N1.N2.N3_2022.03.04_3
for the commit that was used during releasing, 3rd revision. Here the_3
is related to theactions
fork
scripts and is independent of the 4th digit in thecore-edc
fork
.You will need potentially many revisions as you will need to push the tag each time you make a change to let the CI use that version, then retry if it failed.
This was tested to work quite well in version 0.7.2 and is detail below.
For the cases that can't be covered with the best effort approach, a fork strategy is detailed below,
see Lost action
If you need more than 1 branch for a single date, be creative in the name, either use DATE+TIME or DATE+suffix. In any case, that scenario is unlikely to happen.
Finding LATEST and LASTOK
LATEST
is the last commit on themain
upstream
branch.LATEST
in this file by the date you find. The date part should be enough.git show --no-patch --format=%ci upstream/main
sed --in-place 's/LATEST/2025-06-07/g' fork.md
LASTOK
is optional and will be defined later.Pin the action versions
LATEST
main
commit fromupstream
git checkout upstream/main
git checkout -b pinned/N1.N2.N3_LATEST
git push fork
core edc fork branch
_today
_1
git tag N1.N2.N3_LATEST_1 pinned/N1.N2.N3_LATEST
git push fork tag N1.N2.N3_LATEST_1
@main
version for theN1.N2.N3_LATEST_1
versioneclipse-edc/.github
forsovity/core-edc-github
eclipse-edc/.github/.github/workflows/task.yml@main
sovity/core-edc-github/.github/workflows/[email protected]_LATEST_1
eclipse-edc/.github/(.*)@main
withsovity/core-edc-github/[email protected]_LATEST_1
From here we have:
Adjust the pinned main
pinned/N1.N2.N3-LATEST
branchN1.N2.N3_LATEST_(N+1)
in theactions
repo@N1.N2.N3_LATEST_N
toN1.N2.N3_LATEST_(N+1)
Lost action
This part describes how to find where a missing action was and how to make it work again.
LASTOK
when thecore-edc
version was released either with:git log --oneline --follow -- '.github/actions/THEACTIONNAME'
git show --no-patch --format=%ci vN1.N2.N3
in thecore-edc
repo. e.g2022-03-04
LASTOK
with the date you found.fork
action
repository the commit on the main branch that happened right before the timethe tagged commit in the core EDC was created.
git log --date=iso -n LINES --before="LASTOK"
git log --date=iso -n 2 --before="2022-03-04"
LINES
to show more than 1 line.pinned/P1.P2.P3_LASTOK
from this older commitP1.P2.P3_LASTOK_1
e.g.P1.P2.P2_2022-03-04_1
actions
forkgit push fork tag P1.P2.P3_LASTOK_1
core-edc
fork
from the pinned latest to that new version.Publishing
0.7.2.x
: publishing and promotinggit checkout sovity/0.7.2 -- .github/workflows/verify.yml build.gradle.kts
0.2.1.x
: publishinggit checkout sovity/0.2.1 -- .github/workflows/publish.yml build.gradle.kts
core-edc
's actions.sovity/
must be published on theAzureTest
instance.v
must be published on theAzure
(non test) instance.v0.2.1
/v0.7.2
skip.signing=true
to thegradle.properties
sovity/
.core-edc
fork on asovity/
branch and merge it.release.md
on the default branch.sovity/N1.N2.N3
with your desired changes, see the patch procedureFinalization
The text was updated successfully, but these errors were encountered: