Skip to content
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

Upload libXRPL flow #5028

Merged
merged 8 commits into from
Aug 15, 2024
Merged

Conversation

godexsoft
Copy link
Collaborator

@godexsoft godexsoft commented May 24, 2024

High Level Overview of Change

Adding a workflow that automatically publishes libxrpl to a custom channel (clio/pr_NUMBER) Artifactory and triggers a workflow in Clio's CI using repository_dispatch.

This flow will only run if the BuildInfo.cpp file or the workflow itself was updated in a PR. Typically this means a new version is proposed.

Publishing the library as soon as possible (i.e. not after merging it or tagging the version) gives us the ability to notify Clio's CI and trigger a full check against the new version of libxrpl. In the future we could automate a notification back from Clio to report whether the checks were successful or not.

This flow will start together with others (if conditions are met) but will not proceed with the upload until essential other checks are done and are either successful or skipped (not cancelled or failed). Currently the essential checks are all test running on linux. Mac and Windows are not on the list. Main reason for that is Mac being flaky and we don't want to fail this step (at least not often).

Two secrets that need to be present in the repo (are already present):

  • CONAN_USERNAME
  • CONAN_TOKEN

And a new one that already was added in order to trigger a workflow on Clio's CI:

  • CLIO_NOTIFY_TOKEN

Here is the flow in Clio CI that does the rest: XRPLF/clio#1433
Currently Clio's side is broken because Conan's channel syntax contains a forward slash - a symbol that is not allowed for artifact names. This will be fixed on Clio side asap (XRPLF/clio#1583).

Context of Change

Recently there was an rc of libxrpl that did not allow consumers to link correctly. We should try and avoid this in the future.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)

API Impact

None.

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.9%. Comparing base (c19a88f) to head (99a39d6).
Report is 9 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5028   +/-   ##
=======================================
  Coverage     74.8%   74.9%           
=======================================
  Files          768     768           
  Lines        63134   63134           
  Branches      8867    8846   -21     
=======================================
+ Hits         47244   47269   +25     
+ Misses       15890   15865   -25     

see 4 files with indirect coverage changes

Impacted file tree graph

@godexsoft godexsoft force-pushed the feature/ci-publish-libxrpl1 branch from 9fed9c9 to f7c169d Compare May 28, 2024 20:45
@godexsoft godexsoft marked this pull request as ready for review May 28, 2024 21:25
paths:
- 'src/ripple/protocol/impl/BuildInfo.cpp'
- '.github/workflows/libxrpl.yml'
branches: [release]
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Here is a patch release PR that targeted master.
  • Here is a major release PR that targeted develop.

Do we channel all of our releases through a single branch? I don't know. Even if we do, I'm not sure we can count on it always happening through a PR. I understand you want to publish a package before the commit is pushed to a protected branch or tagged. Can we get an expert on the release process to chime in? @seelabs?

Once we determine the right condition to check, we can think about how to deduplicate some of the steps here. Maybe we can move this workflow into a single conditional step at the end of the test workflow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would be indeed useful to know if release is supposed to always be used for this purpose @seelabs 👍

When implementing this i deliberately sacrificed duplication for non-intrusiveness. I agree we can deduplicate quite a bit but i thought we would be better off creating a separate issue/PR for that. Let me know what you think @thejohnfreeman @seelabs .

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've added a workflow in a branch that builds the Conan package locally and tests that an example downstream package can import it successfully. We could add a job to upload the recipe (and binary?) conditional on that test (and whatever conditions we decide determine a release).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how useful it is to build an "example" package. Unless you have a package that uses everything libxrpl provides of course, in which case that's great.
I only really care that Clio (the only real/important consumer afaik) still works so I'd certainly prefer to leave the notification step that triggers Clio's CI. If you want to add an example package build in between - i have no problem with that.
I personally prefer to get simple things like CI out of the way and functional quicker and then improve if needed later.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is useful to test that, at least, libxrpl can be found and linked by a dependent package. It is possible to build a Conan package that doesn't actually export anything that can be linked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it's not required. But if i create a PAT from say my account it will probably use my account when creating PRs/issues from that workflow.
It's the easiest option.. but perhaps having some "XRPLD[bot]" account would be preferred?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

or would setting "resource owner" change the PR/issue author, do you know?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know. It can be tested though. Is there someone with organization permissions who we can delegate this to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have evidence that it will still use the github-actions account to create the PR even if i use a PAT created for my account. I can create one and ask @ximinez to set it up in this repo.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not all releases are guaranteed to pass through release. Specifically, a hotfix (e.g. 2.2.1) can go directly to master without touching develop or release until it is backported. Also the paths and branches conditions are essentially ANDed together. No changes should ever get to release (or master for that matter) without the version number changing in BuildInfo.cpp, which would make that check redundant. Conversely, BuildInfo.cpp is almost never changed except to change the version number.

This contradicts what @seelabs said above. Take the example of 2.2.1, the reason is simple: The issue wasn't discovered in 2.2.0 until well after the first 2.3.0 beta had been merged to release. At that point, the only options were either roll back release (very bad), or let master and release diverge (not so bad).

Therefore, I suggest either:

  • Remove paths, and change branches to use both release and master.
  • Remove branches, and leave paths as-is.

Both risk adding extra builds, but drastically reduce the chances of missing a build, which seems like it would be worse.

@godexsoft godexsoft requested a review from seelabs August 1, 2024 20:15
paths:
- 'src/ripple/protocol/impl/BuildInfo.cpp'
- '.github/workflows/libxrpl.yml'
branches: [release]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not all releases are guaranteed to pass through release. Specifically, a hotfix (e.g. 2.2.1) can go directly to master without touching develop or release until it is backported. Also the paths and branches conditions are essentially ANDed together. No changes should ever get to release (or master for that matter) without the version number changing in BuildInfo.cpp, which would make that check redundant. Conversely, BuildInfo.cpp is almost never changed except to change the version number.

This contradicts what @seelabs said above. Take the example of 2.2.1, the reason is simple: The issue wasn't discovered in 2.2.0 until well after the first 2.3.0 beta had been merged to release. At that point, the only options were either roll back release (very bad), or let master and release diverge (not so bad).

Therefore, I suggest either:

  • Remove paths, and change branches to use both release and master.
  • Remove branches, and leave paths as-is.

Both risk adding extra builds, but drastically reduce the chances of missing a build, which seems like it would be worse.

@ximinez ximinez self-requested a review August 5, 2024 20:30
.github/workflows/libxrpl.yml Outdated Show resolved Hide resolved
.github/workflows/libxrpl.yml Show resolved Hide resolved
.github/workflows/libxrpl.yml Outdated Show resolved Hide resolved
.github/workflows/libxrpl.yml Outdated Show resolved Hide resolved
.github/workflows/libxrpl.yml Outdated Show resolved Hide resolved
@godexsoft
Copy link
Collaborator Author

@ximinez should we wrap this one up? Anything in the PR needs changing?

Copy link
Collaborator

@ximinez ximinez left a comment

Choose a reason for hiding this comment

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

Yep. Looks good.

@godexsoft godexsoft merged commit 31f28a0 into XRPLF:develop Aug 15, 2024
21 of 22 checks passed
@ximinez ximinez added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Aug 15, 2024
ximinez added a commit that referenced this pull request Aug 15, 2024
Implements a CI workflow that detects when a new version of libxrpl is
proposed, uploads it to artifactory under the `clio` channel and
notifies Clio's CI to check this newly proposed version.
vlntb pushed a commit to vlntb/rippled that referenced this pull request Aug 23, 2024
Implements a CI workflow that detects when a new version of libxrpl is
proposed, uploads it to artifactory under the `clio` channel and
notifies Clio's CI to check this newly proposed version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants