This repository was archived by the owner on Apr 7, 2025. It is now read-only.
[RFD-0001] Multi-Project Workflow Hierarchy #27
AleksandarCole
started this conversation in
RFD
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
[RFD - 0001] - Multi-Project Workflow Hierarchy
@AleksandarCole
@DamjanBecirovic
Draft
What
Semaphore allows users to trigger workflows via API. In certain cases, a workflow in
Project A
may trigger a workflow inProject B
, creating a chain of dependent workflows. The multi-project workflow hierarchy feature will enable users to:Why
Currently, projects in Semaphore are repository-based and operate in isolation, without sharing information. However, there are many scenarios where an action in one repository needs to trigger a build in another. For users with such interconnected workflows, there is presently no way to see the relationships between these builds. This feature will provide visibility into these inter-project dependencies, improving the management and understanding of complex workflows.
Details
Use-cases
In an organization with several projects and independent teams, API calls are employed within each project to initiate workflows across various projects based on pipeline conditions.
For instance, a workflow within
project A
can trigger workflows acrossproject B
,project C
, andproject D
. Moreover,project C
can further trigger workflows withinproject E
andproject F
.The team working on
project C
wants to:project A
that triggered their workflow.project E
andproject F
that were triggered by their workflow.The
lead
orDevOps
person wants to:Problems
Problem 1 - Traceability > No parent traceability in API
Users can run the workflow through the API in the following way:
However, there is no way to forward additional metadata about the
parent
workflow that initiated the API call.Problem 2 - Storage > No way to store dependency tree
There is no place in-app that allows you to store this dependency tree. On idea was to store it in the
artifacts
but they are scoped on project level. This information would need to be available across multiple projects within the organization.Problem 3 - Navigation/UX > No UI that displays this info on workflow page
If this info were available, it would need to be easily accessible within the workflow page. For example, the team that works on
project C
would open aproject C
workflow and should be able to see the dependency tree for that workflow somewhere in UI.At this moment we don't have any section that would render this.
Problem 4 - Navigation/UX > No links in job logs
Workflow on
project A
triggers through an API call in a job workflow onproject C
. The API returns information aboutchild
workflow that was triggered in a response, allowing the link to said workflow to be printed out in job log output.However, we do not render links in the job logs, so the user that wants to open it has to copy the url string and paste it in a browser.
Solutions
Solution 1 - Traceability > Extend the API
We can extend the API to support the additional parameters describing the
parent
workflow like this:This way we would:
parent
workflow that triggered itparent
workflow information as environment variables inchild
workflowPotential extended scope to explore: All this information is available in the OIDC token. User could just pass the token in the API.
Solution 2 - Traceability > Extend the promotions
Alternatively, we could extend the promotions to allow builds on other projects to be triggered like this:
This would make such workflows a first-class citizen, however this idea needs to be discussed with the
pipelines
team as there are many open questions (eg. permissions for triggering a workflow on a completely different project).Solution 3 - Storage > S3 bucket on organization level
Similar to artifacts, we could introduce the option of having an S3 bucket scoped on the organization level.
This storage can then be in turn used by the users to generate various reports in their jobs and edit them. We can then render these user-generated artifacts in a special part of the UI if they fit predefined format.
Pros:
Cons:
Solution 4 - Storage > Introduce a new table
We can introduce a new table for the purpose of tracking these dependencies. Engineering team believes that introducing such table would be faster than
Solution 3
and more straightforward. It would also allow us to build better UX.Pros:
Cons:
Solution 3
> it would store only data related to dependency treeSolution 5 - Navigation/UX > Reports tab
App design link: HERE
We can add a new tab on workflow and job pages called
Report
Content of this tab would be generated based on the
.html
or.md
files built by user and stored in the bucket described inSolution 3
. Front would need to be able to somehow identify the correct file to render in the report tab.Assuming that the user generates a report that looks like this:
The content of the report would be rendered on the workflow page like this:
Solution 6 - Navigation/UX > Hierarchy tab
App design link: HERE
This solution depends on
Solution 4
for data storage.If we go this route, it would not be too complex to build a new tab on the workflow page called
Hierarchy
that contains full dependency tree.This tab would appear only if there is are
parent
orchild
workflows exist, and would show the full chain. The current workflow would be marked in the chain by blue outline.It would look something like this:
Screen.Recording.2024-06-07.at.10.47.19.mov
This is not a final design, there's some additional UI/UX things to figure out (eg. branches, collapsing the boxes a bit like what we do for tasks etc.)
If this solution is combined with
Solution 2
we could makemulti-project workflows
a first-class citizen.Solution 7 - Navigation/UX > Links in job logs
This is WIP and hasn't been reviewed with engineering yet. Leaving it here as a note, but it will probably be extracted as a separate discussion.
Next steps
Beta Was this translation helpful? Give feedback.
All reactions