Fix/GitHub deployment time calculation#8715
Open
Ke-vin-S wants to merge 4 commits intoapache:mainfrom
Open
Conversation
Introduce FinishedDate field in GithubDeployment to represent success-priority deployment completion timestamp. This field allows distinguishing SUCCESS timestamp from latest status update time while preserving backward compatibility.
Add logic to derive FinishedDate from deployment statuses. Preference order: 1. Latest SUCCESS timestamp 2. Latest terminal timestamp (FAILURE/ERROR/INACTIVE/ACTIVE) This improves deployment lifecycle accuracy without modifying existing LatestStatus semantics.
Update ConvertDeployment to use tool-layer FinishedDate when populating domain TaskDatesInfo.FinishedDate. Duration is now calculated using resolved finished time instead of UpdatedDate.
Add migration script to auto-migrate GithubDeployment and create nullable finished_date column.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What does this PR do?
Fix deployment finish time calculation in the GitHub GraphQL plugin.
Previously, DevLake used the latest deployment status timestamp (often inactive) as the deployment completion time. However, GitHub marks a deployment as inactive when it is superseded by a newer successful deployment, which may occur significantly later than the actual success event.
This PR introduces a new nullable field finished_date in GithubDeployment and implements success-priority logic:
Use the latest success status timestamp if present.
Does this close any open issues?
Closes #8654
Other Information