Building App in Studio does not use last commit to master if gitea is updated directly
Describe the bug
Build app in Altinn Studio does not use last commit to master (as stated). It uses the last commit available during page load.
If a developer pushes code to gitea or updates gitea directly, the commit will not be built.
To build the last commit you have to press pull or push on another page in Altinn Studio for the commit to update.
To Reproduce
Steps to reproduce the behavior:
- Create an app in Studio
- Go to "deploy page"
- Change something in Gitea.
- Click build in Studio
- The commit that is built is not the last commit.
Expected behavior
- During click button to build the last commit needs to be fetched from gitea.
- Consider having an interval check to get the last commit from gitea.
I did this two times yesterday. Worked for mye. @jeevananthank i think we should really verify if this is still a problem. (i updated the nuget version in app directly in gitea)
This was a frontend issue. The frontend fetches the last master commit-ID when the page loads. If someone commits after page load, before someone click release. The last commit will not be built.
Could reproduce the issue as @matsgm says. With Deploy page loaded, and one commits a change directly in gitea and starting a build from Studio does not the use the latest commit, but the last commit when the deploy page is loaded. (a refresh of deploy page would solve this problem)
@jeevananthank i assume we still have the same issue?
@jeevananthank i assume we still have the same issue?
yes, this is still an issue. an refresh of the deploy side solves the issue.
When clicking deploy, make sure to get the latest version first 😄
Related issue: https://github.com/Altinn/altinn-studio/issues/3181 Perhaps we should show the commit hash as suggested, as a link to the commit in Gitea. That would, at least, make it very clear which commit is being built. However, that means that the suggested approach above might cause a mismatch.
Suggestion: Instead of having the form to build a version directly available, we use the same pattern as we have used other places, with a "+ Lag ny versjon" button.
- Clicking this button shows the form, and fetches the latest commit from master at the time of the button click. This way we at least ensure that we get the latest commit from when the user is ready to build a new version
- The commit hash could be shown together with the "siste commit til master" text/link. Possibly also with the commit message for reference?
cc: @Annikenkbrathen
Something like (in concept, please excuse the quality 😂 ):
After clicking the button, we could show the "create version" form as is, possibly with some extra information:
I agree, it seems good to have a button if it solves the issue.
It is a bit of an odd placement for such an important interaction. The button is not very visible and might be perceived as a less important action or ignored. We should change several things here, and I will look into a redesign of the publish page in this task.
Or if it is not urgent, can this issue be blocked until design has worked on the new design?
Works nicely 👍