Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport 2.x] Add synchronous execution option to workflow provisioning(#990) #1009

Merged

Conversation

junweid62
Copy link
Contributor

Description

Manually backport #990 to 2.x

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions github-actions bot added the backport 2.x backport PRs to 2.x branch label Jan 17, 2025
@junweid62 junweid62 changed the title Backport/backport 990 to 2.x [backport 2.x] Add synchronous execution option to workflow provisioning Jan 17, 2025
@junweid62 junweid62 changed the title [backport 2.x] Add synchronous execution option to workflow provisioning [backport 2.x] Add synchronous execution option to workflow provisioning(#990) Jan 17, 2025
@junweid62 junweid62 changed the base branch from main to 2.x January 17, 2025 00:29
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 45.34884% with 94 lines in your changes missing coverage. Please review.

Project coverage is 76.87%. Comparing base (eb58687) to head (e362da2).
Report is 3 commits behind head on 2.x.

Files with missing lines Patch % Lines
.../transport/ReprovisionWorkflowTransportAction.java 6.06% 29 Missing and 2 partials ⚠️
...rk/transport/ProvisionWorkflowTransportAction.java 9.09% 28 Missing and 2 partials ⚠️
...rch/flowframework/util/WorkflowTimeoutUtility.java 51.16% 19 Missing and 2 partials ⚠️
...ework/transport/CreateWorkflowTransportAction.java 76.47% 3 Missing and 1 partial ⚠️
...earch/flowframework/transport/WorkflowRequest.java 78.57% 0 Missing and 3 partials ⚠️
...ramework/transport/ReprovisionWorkflowRequest.java 71.42% 0 Missing and 2 partials ⚠️
...arch/flowframework/transport/WorkflowResponse.java 88.23% 0 Missing and 2 partials ⚠️
...h/flowframework/rest/RestCreateWorkflowAction.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #1009      +/-   ##
============================================
- Coverage     78.08%   76.87%   -1.21%     
- Complexity      993     1010      +17     
============================================
  Files            99      100       +1     
  Lines          4617     4774     +157     
  Branches        431      453      +22     
============================================
+ Hits           3605     3670      +65     
- Misses          832      909      +77     
- Partials        180      195      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@junweid62 junweid62 force-pushed the backport/backport-990-to-2.x branch from 34425a2 to 84ae902 Compare January 17, 2025 02:01
dbwiddis
dbwiddis previously approved these changes Jan 17, 2025
@dbwiddis
Copy link
Member

There's a whole bunch of commits here not part of the backport. :)

I like to ignore the instructions on the main pr and do the following:

  1. Check out main and pull upstream with your merged PR
  2. Checkout 2.x and pull upstream
  3. git checkout -b backport-branch-name-here
  4. git cherry-pick hash-goes-here (copy/paste hash from git log or the website commits page)
  5. Resolve conflicts that prevented it from merging in the first place
  6. git cherry-pick --continue
  7. Commit.

For now let's try something different.... will wait for integ tests to get fixed and merge the other 2 backports, then toggle the backport label on the main PR and see if it generates properly the next time.

@dbwiddis dbwiddis self-requested a review January 17, 2025 02:06
@dbwiddis dbwiddis dismissed their stale review January 17, 2025 02:07

too many commits on branch

@junweid62 junweid62 force-pushed the backport/backport-990-to-2.x branch from 84ae902 to ba65765 Compare January 17, 2025 02:12
…-project#990)

* Add synchronous execution option to workflow provisioning

Signed-off-by: Junwei Dai <[email protected]>

* code refactor

Signed-off-by: Junwei Dai <[email protected]>

* add change log

Signed-off-by: Junwei Dai <[email protected]>

* refactor code based on comment

Signed-off-by: Junwei Dai <[email protected]>

* fix spotless check

Signed-off-by: Junwei Dai <[email protected]>

* Limit workflow timeout to a range of 1 to 300 seconds

Signed-off-by: Junwei Dai <[email protected]>

* Limit workflow timeout to a range of 1 to 300 seconds

Signed-off-by: Junwei Dai <[email protected]>

* Limit workflow timeout to non-negative

Signed-off-by: Junwei Dai <[email protected]>

* Add synchronous execution to reprovision

Signed-off-by: Junwei Dai <[email protected]>

* remove unsued common value

Signed-off-by: Junwei Dai <[email protected]>

* add reprovision sync execution

Signed-off-by: Junwei Dai <[email protected]>

* fix test for WorkflowTimeoutUtilityTests

Signed-off-by: Junwei Dai <[email protected]>

* fix test name for WorkflowTimeoutUtilityTests

Signed-off-by: Junwei Dai <[email protected]>

* Add comments to explain AtomicBoolean usage in WorkflowTimeoutUtility, update error message

Signed-off-by: Junwei Dai <[email protected]>

* fix spotless check

Signed-off-by: Junwei Dai <[email protected]>

* addressed some comments

Signed-off-by: Junwei Dai <[email protected]>

---------

Signed-off-by: Junwei Dai <[email protected]>
Co-authored-by: Junwei Dai <[email protected]>
@junweid62 junweid62 force-pushed the backport/backport-990-to-2.x branch from ba65765 to e362da2 Compare January 17, 2025 02:16
@dbwiddis dbwiddis merged commit 8d4550d into opensearch-project:2.x Jan 22, 2025
30 of 31 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/flow-framework/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/flow-framework/backport-2.x
# Create a new branch
git switch --create backport/backport-1009-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8d4550dbd233f1f1d0ddd07c864a3127f2575fad
# Push it to GitHub
git push --set-upstream origin backport/backport-1009-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/flow-framework/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1009-to-2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport PRs to 2.x branch backport-failed Applied to PRs when the automatic backport fails
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants