Skip to content

feat(workflows): Reuse validate-release#9736

Closed
candiduslynx wants to merge 6 commits into
mainfrom
release-please--branches--main--components-test-workflow
Closed

feat(workflows): Reuse validate-release#9736
candiduslynx wants to merge 6 commits into
mainfrom
release-please--branches--main--components-test-workflow

Conversation

@candiduslynx
Copy link
Copy Markdown
Contributor

@candiduslynx candiduslynx commented Apr 5, 2023

This builds on top of ideas from #9668 and can safely replace it.

wait-for-required-workflows change is required to make it wait for skipped jobs, too.

Skip logic is tested via #9760

@candiduslynx candiduslynx changed the title Release please branches main components test workflow chore(test): Test validate-release reusing Apr 5, 2023
@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch 3 times, most recently from 22799b8 to aa147a3 Compare April 7, 2023 08:16
@candiduslynx candiduslynx changed the title chore(test): Test validate-release reusing feat(workflows): Reuse validate-release Apr 7, 2023
@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch 2 times, most recently from 14b10eb to bb5120f Compare April 7, 2023 08:24
@candiduslynx candiduslynx marked this pull request as ready for review April 7, 2023 08:26
@candiduslynx candiduslynx self-assigned this Apr 7, 2023
@candiduslynx candiduslynx added the automerge Automatically merge once required checks pass label Apr 7, 2023
@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch from 7e90918 to 5fa359c Compare April 9, 2023 09:04
@candiduslynx
Copy link
Copy Markdown
Contributor Author

@erezrokah I've updated the code to address merge conflict, it's ready for merge now

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

I'm not sure this is working as expected.
For the skip test the wait for all took 15m 23s:
image
and the AWS workflow took 16m 47s:
image

I'd expect the wait for all workflow to finish last.

For the non skip test (this PR):
The wait for all took 7m 33s:
image

and the AWS workflow took 14m10s:
image

so the gap is even higher.

I recommend scoping this change to a single plugin. That would make it easier to debug and review. If it works for a single plugin, we can add it to others. WDYT?

Comment thread .github/workflows/wait_for_required_workflows.yml
@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch from 5fa359c to c2a68f2 Compare April 9, 2023 12:12
@candiduslynx
Copy link
Copy Markdown
Contributor Author

@erezrokah the issue with timelines was caused by the merging one branch into the other (basically, last commit was the same) as it messed a bit with GH trying not to do the same work several times.

I've updated the branches and have them diverged a bit, it should help with the proper testing.

As for the fact that the AWS source job might take a bit longer than the wait -- it's all in the wait logs (we got the successful status from API, nothing else to wait). Maybe the time displayed for the job also includes some additional tine for artifacts/ something else?

@candiduslynx candiduslynx requested a review from erezrokah April 9, 2023 12:17
@candiduslynx
Copy link
Copy Markdown
Contributor Author

@erezrokah
Copy link
Copy Markdown
Member

Should this PR be ready? I see the AWS still running but wait for all completed:
image

image

@erezrokah
Copy link
Copy Markdown
Member

As I mentioned, it might be easier to test this for a single plugin instead of all of them. Regardless I think we would like to introduce this change incrementally instead of all plugins as the same time.

@candiduslynx
Copy link
Copy Markdown
Contributor Author

As I mentioned, it might be easier to test this for a single plugin instead of all of them. Regardless I think we would like to introduce this change incrementally instead of all plugins as the same time.

@erezrokah seems there's a bug in the logic as we see in here that the following entries triggered the workflows to be marked ready:

{"name":"plugins/source/awspricing","conclusion":"success"},
{"name":"plugins/source/awspricing","conclusion":"success"}

So we saw a double entry for awspricing and no for aws, interesting...
I think fixing the logic for the wait-for-required-workflows may be out of scope of this PR.

I can do a separate PR introducing this change only to AWS source testing, and, if we're satisfied with the results, we can merge this and then do refactoring for the other plugin workflows, WDYT?

@erezrokah
Copy link
Copy Markdown
Member

erezrokah commented Apr 9, 2023

So we saw a double entry for awspricing and no for aws, interesting...
I think fixing the logic for the wait-for-required-workflows may be out of scope of this PR.

I haven't seen this issue before, so we should probably fix it before doing any other CI changes.
I'll try to reproduce in a separate PR, without this change and see if it does.

I can do a separate PR introducing this change only to AWS source testing, and, if we're satisfied with the results, we can merge this and then do refactoring for the other plugin workflows, WDYT?

That sounds good, but it will have to wait for the fix in the wait for all logic

@erezrokah
Copy link
Copy Markdown
Member

erezrokah commented Apr 9, 2023

This SDK PR #9661 doesn't seem to have this issue:
image

image

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Added a couple more comments on the code itself, though we should still ensure it works as expected per the previous comments

Comment thread .github/workflows/wait_for_required_workflows.yml Outdated
Comment thread .github/workflows/wait_for_required_workflows.yml Outdated
Comment thread .github/workflows/wait_for_required_workflows.yml Outdated
Comment thread .github/workflows/validate_release.yml Outdated
@erezrokah
Copy link
Copy Markdown
Member

Maybe we can add the reusable workflow without the skip logic at first to simplify things?

@candiduslynx
Copy link
Copy Markdown
Contributor Author

The issue is that the reusable workflow will still require the name validate-release / validate-release to be added, and the skip logic is really minor.
The logic issue we saw when a couple of runs with the same name (awspricing) were shown is due to the paging, I presume.

And the fact that we basically check for the following:

  • any failed builds present? -> fail
  • the len of filtered completed runs == the amount of runs we wait for -> success

In the run we had issue with we had the same entry counted twice, so that's why we skipped the wait and just went with it.

I will create a separate issue to fix the workflow behavior in the following way (I think it's non-blocking for now):

  • account for the id of the run we see (so we skip all the runs we already processed)
  • move from array to map (name -> amount) so that we properly check the runs for a specific action

@candiduslynx
Copy link
Copy Markdown
Contributor Author

@erezrokah I've extracted simple (no cgo) valiate-release for AWS Source plugin into #9780.
I'll be following up with cgo-releated ones after that one is merged, and then I'll create PRs to replace all others

@erezrokah
Copy link
Copy Markdown
Member

erezrokah commented Apr 10, 2023

I will create a separate issue to fix the workflow behavior in the following way (I think it's non-blocking for now):

I think if we have an issue with the wait for all logic, we should fix it first before making other CI changes, otherwise we won't be able to verify the changes we make.

Also I haven't seen that issue on other PRs, so we'll need to investigate. We know what happens on this PR, but haven't confirmed the root cause, nor that it happens on all PRs

@candiduslynx
Copy link
Copy Markdown
Contributor Author

candiduslynx commented Apr 10, 2023

Also I haven't seen that issue on other PRs, so we'll need to investigate. We know what happens on this PR, but haven't confirmed the root cause, nor that it happens on all PRs

I think it might be caused by paging by 100 entries (as this is one of the PRs where we have a lot of actions running).
As 100 is max we either need to verify that there's no issue with SDK or account for possible duplicates.

I really think that we can just do it in a separate issue and not make this blocking, as the issue was present even before (take any PR that updates some library for a lot of plugins).

Namely, the SDK PR #9661 you mentioned actually has this issue:
Take a look at the last reported runs.
There's no entry for plugins/source/aws being successful, but we possibly have some duplicate there because of the paging, that's why we just conclude successfully.

@erezrokah
Copy link
Copy Markdown
Member

There's no entry for plugins/source/aws being successful, but we possibly have some duplicate there because of the paging, that's why we just conclude successfully.

💯 Agree good catch, seems like there's a duplicate for plugins/source/googleads

I really think that we can just do it in a separate issue and not make this blocking, as the issue was present even before (take any PR that updates some library for a lot of plugins).

Let's start with #9793 and log the IDs.

I don't think we should introduce non urgent (big) CI changes if we have a bug in our CI. The motivation for introducing re-usable workflows was to simplify the caching logic, but since then we discovered that we won't need to refactor it, and only fix 4 workflows.

So re-usable workflows seems to be more about removing code duplication (that we haven't had issues with before).
I don't see the urgency to push them

kodiakhq Bot pushed a commit that referenced this pull request Apr 10, 2023

#### Summary

Related to #9736 (comment). We've seen cases were apparently the GitHub JS SDK returns duplicate check runs, so adding a log for the ID to see what's up.

<!--
@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch from dd8f6c9 to 6ecc2ab Compare April 10, 2023 11:04
@candiduslynx
Copy link
Copy Markdown
Contributor Author

@erezrokah I've created #9797 to address the duplicates issue (possibly, just do the most obvious filter by ID) and make it working again.

@erezrokah
Copy link
Copy Markdown
Member

erezrokah commented Apr 10, 2023

@erezrokah I've created #9797 to address the duplicates issue (possibly, just do the most obvious filter by ID) and make it working again.

Can you spot duplicate IDs in https://github.com/cloudquery/cloudquery/actions/runs/4656875292/jobs/8240920196?pr=9736#step:4:381?

I did not find any. That run is even worse as it doesn't wait for CLI Windows and AWS

@erezrokah
Copy link
Copy Markdown
Member

erezrokah commented Apr 10, 2023

I counted 60 validate release, 60 workflows (CLI, Scaffold and plugins), 4 test policies, which seems ok.

Update

Looks like we're seeing 60 validate release workflows, but expecting 58 (see validate release count in Actions: for the expected count), so that explains why the CLI Windows and AWS workflow were skipped.

This seems like a different issue than the duplicate IDs, WDYT?

@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch from 6ecc2ab to cfbf8dd Compare April 10, 2023 12:56
candiduslynx and others added 6 commits April 10, 2023 17:37
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
@candiduslynx candiduslynx force-pushed the release-please--branches--main--components-test-workflow branch from cfbf8dd to 2fb1c55 Compare April 10, 2023 14:37
@candiduslynx
Copy link
Copy Markdown
Contributor Author

Drop for now, will take another shot after #9780

@candiduslynx candiduslynx deleted the release-please--branches--main--components-test-workflow branch April 10, 2023 15:34
kodiakhq Bot pushed a commit that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants