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

[REVERTED] Use file-scoped namesapces in RabbitMQ.Client project #1202

Merged

Conversation

ArminShoeibi
Copy link
Contributor

Proposed Changes

Hi there folks.
this merge request changes old namespaces to file-scoped namespaces in RabbitMQ.Client project.
if we want to change other projects such as tests and samples we need to drop net4.7.2 support.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

Tests of net472
Before:
net472-tests-before

After:
net472-tests-after

Tests of net6.0
Before:
net6-tests-before

After:
net6-tests-after

@ArminShoeibi ArminShoeibi mentioned this pull request May 7, 2022
@michaelklishin
Copy link
Member

@ArminShoeibi thank you for taking the time. What's the minimum .NET requirement with this change? I see it requires C# 10 but we express requirements in terms of .NET release series. I am not sure we can drop 4.7 at this point, although there were recent discussions about going to 4.8 or 5.0.

Using old style namespaces in tests and examples is OK. We need to understand what this PR means for version requirements before merging.

@michaelklishin
Copy link
Member

michaelklishin commented May 7, 2022

I see our tests already target .NET 6.0. Nice. RUNNING_TESTS.md is now up-to-date for May 2022, with the potential exception of running individual tests.

@ArminShoeibi I'm quite sure the failing tests you see require a locally running RabbitMQ
node as I don't get any in main:

Test Run Successful.
Total tests: 252
     Passed: 246
    Skipped: 6
 Total time: 10.1903 Minutes

@michaelklishin
Copy link
Member

All tests pass on this branch as well:

Test Run Successful.
Total tests: 252
     Passed: 246
    Skipped: 6
 Total time: 10.3054 Minutes

@michaelklishin
Copy link
Member

Found the supported minimum version discussion: #1189.

@ArminShoeibi
Copy link
Contributor Author

I see our tests already target .NET 6.0. Nice. RUNNING_TESTS.md is now up-to-date for May 2022, with the potential exception of running individual tests.

@ArminShoeibi I'm quite sure the test failures you see require a locally running RabbitMQ node as I don't get any in main:

Test Run Successful.
Total tests: 252
     Passed: 246
    Skipped: 6
 Total time: 10.1903 Minutes

Oh I got it, So I needed a RabbitMQ node on my localhost
Thank you dear Michael @michaelklishin

@michaelklishin michaelklishin merged commit 1713f50 into rabbitmq:main May 8, 2022
@ArminShoeibi ArminShoeibi deleted the feat/file-scoped-namespaces branch May 8, 2022 20:09
@lukebakken lukebakken added this to the 7.0.0 milestone May 9, 2022
@lukebakken lukebakken self-assigned this May 9, 2022
@michaelklishin
Copy link
Member

@ArminShoeibi @lukebakken should we backport this to 7.x? The milestone says so, and it would be much easier to backport all future changes from main to 7.x if we do.

I can spend some time on doing that if you agree (and no one else volunteers!)

@ArminShoeibi
Copy link
Contributor Author

@ArminShoeibi @lukebakken should we backport this to 7.x? The milestone says so, and it would be much easier to backport all future changes from main to 7.x if we do.

I can spend some time on doing that if you agree (and no one else volunteers!)

I'm okay with it.

@michaelklishin
Copy link
Member

I run into

projects/RabbitMQ.Client/client/api/IBasicConsumer.cs(98,13): error CS0246: The type or namespace name 'ReadOnlyMemory<>' could not be found

as soon as I change any or all .csproj files to use

<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<LangVersion>latest</LangVersion>

on the 7.x branch. Since ReadOnlyMemory<> comes from the System.Runtime assembly,
I am not sure what reference or import may be missing.

@michaelklishin michaelklishin mentioned this pull request May 15, 2022
3 tasks
@michaelklishin michaelklishin removed this from the 7.0.0 milestone May 15, 2022
@michaelklishin
Copy link
Member

michaelklishin commented May 15, 2022

I concluded that we should revert this. It's a nice feature but it makes backports of PRs between branches impossible unless they all use it, and it requires C# 10, which means all branches we support in any capacity won't be able to adopt it for a good year if not two.

michaelklishin added a commit that referenced this pull request May 15, 2022
michaelklishin added a commit that referenced this pull request May 15, 2022
…amespaces"

This reverts commit 1713f50, reversing
changes made to f8c7b9d.

It's a nice feature but it makes it impossible to backport things
from main to 7.x and 6.x unless those branches also adopt it.

So file-scoped namespaces are not necessary worth the backporting pain for library
maintainers.

Conflicts:
	projects/RabbitMQ.Client/client/api/DefaultEndpointResolver.cs
	projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.Recording.cs
	projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs
@michaelklishin michaelklishin changed the title Use file-scoped namesapces in RabbitMQ.Client project [REVERTED] Use file-scoped namesapces in RabbitMQ.Client project May 15, 2022
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.

3 participants