Skip to content

Flow profiles#130

Open
johnbilt wants to merge 59 commits into
bbc:mainfrom
johnbilt:flow-profiles
Open

Flow profiles#130
johnbilt wants to merge 59 commits into
bbc:mainfrom
johnbilt:flow-profiles

Conversation

@johnbilt

@johnbilt johnbilt commented May 20, 2025

Copy link
Copy Markdown
Collaborator

Details

Add the content of flow profiles to aid with the creation of flows in stores where there are house formats being used. Also significantly simplifies matching flows across edit by reference workflows

Jira Issue (if relevant)

Jira URL:

Related PRs

If merged before #115, add the new endpoints to the auth logic listings in that PR. If merged after, add that logic in this PR

Submitter PR Checks

(tick as appropriate)

  • PR completes task/fixes bug
  • API version has been incremented if necessary
  • ADR status has been updated, and ADR implementation has been recorded
  • Documentation updated (README, etc.)
  • PR added to Jira Issue (if relevant)
  • Follow-up stories added to Jira

Reviewer PR Checks

(tick as appropriate)

  • PR completes task/fixes bug
  • Design makes sense, and fits with our current code base
  • Code is easy to follow
  • PR size is sensible
  • Commit history is sensible and tidy

Info on PRs

The checks above are guidelines. They don't all have to be ticked, but they should all have been considered.

@johnbilt
johnbilt requested a review from a team as a code owner May 20, 2025 10:50

@himslm01 himslm01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few readability improvements.

Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated

@samdbmg samdbmg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me overall: a good approach of maintaining flexibility while constraining in a way to make it easier to use.

I've inlined a handful of suggestions, and a couple of nits

Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread docs/appnotes/00xx-using-flow-profiles.md Outdated
Comment thread api/schemas/profile.json Outdated
Comment thread api/schemas/flow-put.json Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
@samdbmg

samdbmg commented Jul 31, 2025

Copy link
Copy Markdown
Member

I've also kicked off the CI for you, so you should be able to see if it passes validation

Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/schemas/flow-put.json
Comment thread api/schemas/flow-technical.json Outdated
{
"type": "object",
"description": "Describes the technical characteristics of a Flow (common properties to all Flows, imported by type-specific specifications)",
"title": "Flow Core",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NIT: Would be good to have the title updated as it keeps the rendered version more readable, there are currently two schemas rendered out as Flow Core

Comment thread api/schemas/flow-common.json Outdated
For workflows where replication of the same content formats are happening on a regular basis then it is recommended that the same Profile is loaded into both stores using the same UUID.
This will mean than when Flows are replicated between the stores then the Profile identifier will continue to link to the metadata.

If the Profile does not exist within the destination store then the Profile ID should continue to be preserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to describe how this interacts with the Profiles endpoint? Should the Profile be created if it doesn't exist? If not, how does it interact with the creation of a Profile with a matching ID? I think the paragraph below covers some of this. It might help if that is moved above this para?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think there is a larger issue here which I'd not spotted. To create a flow you provide either a profile or the full flow metadata. If the profile does not exist in the store then you can't actually create the flow as there is no where to get the technical metadata from. So I think you either have to fail the creation and then the calling system either needs to create the profile and then re-try and flow creation or drop the profile and just create the flow directly. The first should be the preferred option as it retains the profile information.

Comment thread docs/appnotes/0020-using-flow-profiles.md Outdated
Comment thread docs/adr/0047-flow-profiles.md Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
It is up to the store implementation whether this is normalised on the flow creation or read-only.

When creating a flow using a Profile it is not possible to override any specific fields as this would invalidate the link to the Profile.
Supplying a Profile ID and technical metadata should result in a 400 validation error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Supplying a Profile ID and technical metadata should result in a 400 validation error
Supplying a Profile ID and technical metadata defined within the specified Profile should result in a 400 validation error

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The line above clearly says it is not possible to override the technical parameters of a profile, so the thinking was you supply a profile or technical metadata not both. So possibly might be better saying Supplying a Profile ID and any technical metadata should result in a 400 validation error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, yes. I had it in my head that a partial profile could be used. But I think that's a future iteration. I think your tweaked message helps. Have we explicitly defined what constitutes "technical metadata" anywhere? Specifically in the human readable version of the spec.

"204":
description: No content. The Flow has been updated.
"400":
description: Bad request. Invalid Flow JSON.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to add conflicting Profiles, and invalid Profile IDs to this return code?

Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/examples/profiles-get-200.json
Comment thread api/schemas/flow-put.json Outdated
@@ -1,10 +1,10 @@
{
"title": "Audio Flow",
"description": "Describes an audio Flow",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When rendered, these descriptions end up as the flow_metadata description for each type at the /profiles endpoint. I think this is unintended given the specific description in the profile schema

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a little ugly, but the best way I could find to make this work is to move the description under the items in oneOf. I think it's because the description is tied to the selectable items, rather than the top level parameter.

Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
"type": "string",
"pattern": "^[^\\s\/]+/[^\\s\/]+$"
},
"avg_bit_rate":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think avg_bit_rate and max_bit_rate either need re-locating such that they aren't in the profile, or we need to add notes to their specific CRUD endpoints stating they can't be modified where profile is set. iirc, they are update-able because they can't always be known when the Flow ingest is configured (e.g. when configuring a push-based live ingest sink) and they may vary over time in some cases.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For tracking purposes, after discussion the plan is as follows:

  1. max_bit_rate will move back to being in the flow as this is something that should be measured at the point of content creation and since it's not fixed should not be in the profile

  2. avg_bit_rate will remain in the profile as in practise this should be the same as the value the encoder is using as it's target bitrate. Also for profiles to work you need to specify the target bitrate to be able to distinguish between different bitrate versions of the same codec (eg 50Mbps v 100Mbps). This change does effectively move average to being an expectation, which is how it's really being used and achieves the aim of the field, so the ADR which talks about this is going to need updating

  3. Wording needs to be added around what happens if someone tries to update a field in a flow which has come from a profile. It is expected that to do this the calling system will remove the profile_id by leaving it blank which will break the link to the profile as part of update message. Updates where the profile_id is still present SHOULD be rejected by the store as invalid with a suitable error message.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've put in #236 to consider making the bitrate thing clearer overall in the spec

Comment thread api/schemas/flow-get.json Outdated
Comment thread api/schemas/flow-put.json Outdated
Comment thread api/schemas/profile.json Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
Comment thread api/TimeAddressableMediaStore.yaml Outdated
johnbilt and others added 9 commits July 21, 2026 12:40
Co-authored-by: James Sandford <james.sandford@bbc.co.uk>
Co-authored-by: James Sandford <james.sandford@bbc.co.uk>
Co-authored-by: James Sandford <james.sandford@bbc.co.uk>
Co-authored-by: James Sandford <james.sandford@bbc.co.uk>
Co-authored-by: James Sandford <james.sandford@bbc.co.uk>
Co-authored-by: James Sandford <james.sandford@bbc.co.uk>
When a Flow is created from a Profile then it inherits all the technical characteristics from the Profile.
This means if that Flow then needs to be updated then consideration needs to be given to the fields which were inherited.

For the standard fields (eg label, description, tags) which form part of the common Flow metadata and provided directly regardless of the Profile then these can be updated through the standard process.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this and the following paragraph need to be moved/copied to the top level Flow PUT endpoint's top level description (the one in the main YAML file) and the average bitrate PUT as it describes normative behaviour Service implementations should implement and Clients should expect. AppNotes are usually considered Informative/advisory.

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.

Flow Profiles

6 participants