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

Use GHA derek-ho/start-opensearch for OpenSearch plugin install tests #4063

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

derek-ho
Copy link
Collaborator

@derek-ho derek-ho commented Feb 21, 2024

Description

This PR uses the externalized start-opensearch action to start opensearch and install the build plugin artifact into it. This was used in security dashboards plugin as well, and decoupling this action was useful as well in case other plugins want to use it themselves. Additionally, this change allows the action to be used with or without security.

This PR deletes the workflow from the security branch and changes the plugin-install workflow to run using the external action.

Issues Resolved

None

Is this a backport? If so, please add backport PR # and/or commits #
No

Testing

Github actions passing

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

@derek-ho derek-ho changed the title Generalize workflow Migrate to external start opensearch github action Feb 21, 2024
@derek-ho
Copy link
Collaborator Author

Companion PR in the dashboards repo: opensearch-project/security-dashboards-plugin#1783

willyborankin
willyborankin previously approved these changes Feb 21, 2024
@cwperks
Copy link
Member

cwperks commented Feb 21, 2024

There are several instances across many repos of Github actions hosted on forks.

Examples:

  1. uses: peternied/find-triggering-pr@v1
  2. https://github.com/opensearch-project/job-scheduler/blob/f453c893a902923bbbc695919219ae0726136aea/.github/workflows/backport.yml#L26
  3. https://github.com/opensearch-project/OpenSearch/blob/main/.github/workflows/gradle-check.yml#L124

I think it makes sense to put these actions in a single repo. One concern I have with actions on forks is that it could produce errors if a fork gets deleted. Do you think its possible to using an existing OpenSearch repo? If not, do you think there's enough justification for creating a new repo to house actions used in repos across the ecosystem?

@derek-ho
Copy link
Collaborator Author

There are several instances across many repos of Github actions hosted on forks.

Examples:

  1. uses: peternied/find-triggering-pr@v1
  2. https://github.com/opensearch-project/job-scheduler/blob/f453c893a902923bbbc695919219ae0726136aea/.github/workflows/backport.yml#L26
  3. https://github.com/opensearch-project/OpenSearch/blob/main/.github/workflows/gradle-check.yml#L124

I think it makes sense to put these actions in a single repo. One concern I have with actions on forks is that it could produce errors if a fork gets deleted. Do you think its possible to using an existing OpenSearch repo? If not, do you think there's enough justification for creating a new repo to house actions used in repos across the ecosystem?

I did have this same thought, since it seems like running OpenSearch or OpenSearch Dashboards with or without plugins seems to be common throughout the org. I moved it into my own action to unblock myself for development. I think creating a shared repo may take some time, but I can start looking into the process.

@derek-ho
Copy link
Collaborator Author

Maybe we can even use: https://github.com/opensearch-project/.github/tree/main/.github. I will raise a PR contributing the work I have and see how maintainers there feel about this idea.

@derek-ho
Copy link
Collaborator Author

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bd3415a) 65.81% compared to head (13ba7d0) 65.85%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4063      +/-   ##
==========================================
+ Coverage   65.81%   65.85%   +0.03%     
==========================================
  Files         298      298              
  Lines       21289    21289              
  Branches     3467     3467              
==========================================
+ Hits        14012    14019       +7     
+ Misses       5538     5533       -5     
+ Partials     1739     1737       -2     

see 3 files with indirect coverage changes

@peternied peternied changed the title Migrate to external start opensearch github action Use GHA derek-ho/start-opensearch for OpenSearch plugin install tests Feb 23, 2024
@peternied peternied merged commit 77ffba4 into opensearch-project:main Feb 23, 2024
82 checks passed
@derek-ho derek-ho added the backport 2.x backport to 2.x branch label Feb 23, 2024
@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/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4063-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 77ffba4838915d67b6f049e5cdd2aa4d0e77fd90
# Push it to GitHub
git push --set-upstream origin backport/backport-4063-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x

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

dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
DarshitChanpura pushed a commit to DarshitChanpura/security that referenced this pull request Jul 30, 2024
DarshitChanpura pushed a commit to DarshitChanpura/security that referenced this pull request Jul 31, 2024
…ts (opensearch-project#4063)

Signed-off-by: Derek Ho <[email protected]>
(cherry picked from commit 77ffba4)
Signed-off-by: Darshit Chanpura <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants