Refactor handling of commit sha in pipeline editor
From this discussion in MR !64576 (merged):
So given those 2 things, I think we need to restructure how we handle the sha. Ideally, we would avoid writing directly to cache at all and start letting apollo does it magic to avoid these mix input signals. To do that, I can kind of think of
2 ways:(we've decided to do the second option, which is:)Don't use rails at all and use the query right away on load for
getLatestCommitShaQuery
. Then we can start using that query to fetch data after a user commits a file or when switching branch to make sure we are always up to date. We would need to refetch data we already have so I would be careful of how long it would add to the loading, but worth checking out for the clarity it would bring to the code.
Since the commit sha currently comes from two sources (rails injection and graphql), this issue aims to unify this into one single source of truth by doing away with rails and fetching the commit sha as a graphql query from the start. This also means removing the client resolver for the commit sha query.