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

Add support for listening to global events #1110

Merged
merged 14 commits into from
Jul 8, 2024

Conversation

adelinag08
Copy link
Contributor

@adelinag08 adelinag08 commented Jun 24, 2024

This PR implements the following:

  • Introduce two new types of EventType that represent global events ( s3:BucketCreated:* and s3:BucketRemoved:*)
  • Add ListenNotificationsAsync that uses ListenBucketNotificationsAsync to listen for global notifications without a bucket name set

Resolves #1109

@adelinag08 adelinag08 marked this pull request as ready for review June 24, 2024 07:52
@ebozduman
Copy link
Collaborator

@adelinag08

Please run dotnet regitlint to address the formatting/lint issue(s).

@adelinag08 adelinag08 requested a review from ramondeklein July 1, 2024 06:59
ramondeklein
ramondeklein previously approved these changes Jul 1, 2024
Copy link
Contributor

@ramondeklein ramondeklein left a comment

Choose a reason for hiding this comment

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

@ebozduman Can you also check?

Copy link
Collaborator

@ebozduman ebozduman left a comment

Choose a reason for hiding this comment

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

We need to add tests to Minio.Functional.Tests for the new notifications as we run the functional tests for PRs.

@ebozduman
Copy link
Collaborator

It looks like dotnet regitlint needs to be run again.

@adelinag08 adelinag08 requested a review from ebozduman July 2, 2024 07:55
@ebozduman
Copy link
Collaborator

ebozduman commented Jul 2, 2024

@adelinag08

Please rerun the regitlint check and check the functional test failure, Failed to detect the expected bucket notification event.
This is the test you've added.

@adelinag08
Copy link
Contributor Author

@ebozduman @ramondeklein I'm encountering an issue with the dotnet regitlint workflow in GitHub Actions. It appears there might be a version incompatibility between the .NET SDK and the IDE MSBuild. The error message indicates that the MSBuild process starts but fails to connect, causing the job to fail. This issue wasn't present with previous .NET SDK (8.0.6) version.

@ramondeklein
Copy link
Contributor

@adelinag08 The latest version of the tooling seems to be more strict. We need to address this to ensure the checks are working again. I have submitted PR #1124 to address this.

@ebozduman
Copy link
Collaborator

ebozduman commented Jul 6, 2024

Please disregard the following comment.
I think the easiest fix is to remove all existing dotnet versions and install .net6.0 and .net8.0 in the ../miniohq/q/preinstall.sh script.

@adelinag08

It looks like this is about your environment and how many .net8.0 versions installed in your work space.
From the logged messages:
~ ~error: MSBuild process was started from '/usr/share/dotnet/sdk/8.0.302/MSBuild.dll', but the IDE failed to connect to it. It means that MSBuild crashed or froze during startup.~ ~error: [MsBuild] (,)->(,) : You must install or update .NET to run this application.~ ~error: [MsBuild] (,)->(,) : App: /usr/share/dotnet/sdk/8.0.302/MSBuild.dll~ ~error: [MsBuild] (,)->(,) : Architecture: x64~ ~error: [MsBuild] (,)->(,) : Framework: 'Microsoft.NETCore.App', version '8.0.6' (x64)~ ~error: [MsBuild] (,)->(,) : .NET location: /usr/share/dotnet/~ ~error: [MsBuild] (,)->(,) : The following frameworks were found:~ ~error: [MsBuild] (,)->(,) : 6.0.[31](https://github.com/minio/minio-dotnet/actions/runs/9776697837/job/27020986927?pr=1110#step:5:32) at [/usr/share/dotnet/shared/Microsoft.NETCore.App]~ ~error: [MsBuild] (,)->(,) : 7.0.20 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]~ ~error: [MsBuild] (,)->(,) : 8.0.7 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]~ ~
MSBuild.dll is from dotnet version 8.0302, Framework (Microsoft.NETCore.App is) version 8.0.6, while 8.07 is the found version.

I also had the similar issue in my environment. I started by removing all of the installations of dotnet versions and cleaned up my space. Please you also clean up your space and re-install only the required dotnet sdk versions.

In my case just running one command was sufficient to clean up all dotnet-sdks:
~ ~$ sudo apt remove dotnet*~ ~
In your case, you may need to run additional commands to clean up your work space, for example if you've used snap to install your packages. Please make sure you don't have any dotnet sdks or runtimes by checking installed versions.
```
$ dotnet --list-sdks
and
$ dotnet --list-runtimes

Nothing is supposed to be listed.
```

Then, you can fresh install 6.0 and 8.0 latest versions.
~ ~$ sudo apt install dotnet-sdk-6.0~ ~$ sudo apt install dotnet-sdk-8.0~ ~
Check the installed versions, sdks and runtimes.
(In my case)
~ ~$ dotnet --list-sdks ~ ~6.0.128 [/usr/lib/dotnet/sdk]~ ~8.0.105 [/usr/lib/dotnet/sdk]~ ~$ dotnet --list-runtimes~ ~Microsoft.AspNetCore.App 6.0.28 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]~ ~Microsoft.AspNetCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]~ ~Microsoft.NETCore.App 6.0.28 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]~ ~Microsoft.NETCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]~ ~

Then run dotnet regitlint command. If everything worked as explained above, I expect it to run successfully.

@adelinag08 adelinag08 requested a review from ramondeklein July 8, 2024 08:05
@ebozduman ebozduman removed the request for review from minio-trusted July 8, 2024 21:53
@harshavardhana harshavardhana merged commit a2589e1 into minio:master Jul 8, 2024
7 checks passed
ebozduman pushed a commit to ebozduman/minio-dotnet that referenced this pull request Jul 12, 2024
ebozduman added a commit that referenced this pull request Jul 24, 2024
* adds missing parts of the fix in PR #1110

* increases subscription wait time

* moves wait to its proper place

* lint changes

* incorporates review comment

* lint changes

* unreported regitlint changes

---------

Co-authored-by: Ersan Bozduman <[email protected]>
ramondeklein added a commit to ramondeklein/minio-dotnet that referenced this pull request Dec 19, 2024
This reverts commit 93007be.

# Conflicts:
#	Minio/Minio.csproj
ramondeklein added a commit to ramondeklein/minio-dotnet that referenced this pull request Dec 19, 2024
This reverts commit a2589e1.

# Conflicts:
#	Minio.Examples/Cases/ListenNotifications.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for listening to Global Events
5 participants