Use unique app spec version (#2535)

The ID is currently preserved on new deployments.
Therefore we also consider the sha and the timestamp.
This commit is contained in:
José Valim 2024-04-02 09:04:10 +02:00 committed by GitHub
parent c699fbbd79
commit 3a9412cafd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -265,9 +265,11 @@ defimpl Livebook.Hubs.Provider, for: Livebook.Hubs.Team do
app_deployments = TeamClient.get_agent_app_deployments(team.id) app_deployments = TeamClient.get_agent_app_deployments(team.id)
for app_deployment <- app_deployments do for app_deployment <- app_deployments do
{seconds, _} = NaiveDateTime.to_gregorian_seconds(app_deployment.deployed_at)
%Livebook.Apps.TeamsAppSpec{ %Livebook.Apps.TeamsAppSpec{
slug: app_deployment.slug, slug: app_deployment.slug,
version: app_deployment.id, version: "#{app_deployment.id}-#{seconds}-#{app_deployment.sha}",
hub_id: team.id, hub_id: team.id,
app_deployment_id: app_deployment.id app_deployment_id: app_deployment.id
} }