Skip to content

Do not require referenced projects to reference LeanCode.Contracts #174

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Saancreed
Copy link
Member

No description provided.

Copy link

github-actions bot commented Jun 6, 2025

Test Results

  2 files  ±0    2 suites  ±0   48s ⏱️ +4s
 82 tests ±0   82 ✅ ±0  0 💤 ±0  0 ❌ ±0 
178 runs  ±0  178 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c2c0294. ± Comparison against base commit 8d17b9b.

Copy link
Member

@jakubfijalkowski jakubfijalkowski left a comment

Choose a reason for hiding this comment

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

Why are we changing this? This was deliberate previously - if you referenced LeanCode.Contracts with the wrong version, you had an error. Now, it will basically silently ignore the error.

@Saancreed
Copy link
Member Author

It was a minor request from @tomaszlaskowskiLC that I experimentally checked how troublesome it would be to implement. The reason for doing this was to be able to reference projects that only contain simple type definitions: enums, maybe DTOs. Such projects have no reason to reference LeanCode.Contracts at all, because doing so would hurt their reusability in other places.

Of course, we can brand the entire practice as an anti-pattern and be done with it, but maybe I could offer a solution like "require types to be found if the compilation references LeanCode.Contracts" instead?

@jakubfijalkowski
Copy link
Member

Such projects have no reason to reference LeanCode.Contracts at all, because doing so would hurt their reusability in other places.

This somewhat changes our initial assumptions. Contracts were contracts, and that's it. You were not supposed to reuse them arbitrarily. I get the purpose (i.e. use the same enum in both domain and contracts) but that is not how we were supposed to do things.

Let's put this back in the backlog and pause this PR.

@tomaszlaskowskiLC
Copy link
Member

As mentioned, that was more of a side request. We're ok with adding LeanCode.Contracts as dependency to these projects in Welliba after updating to new version.

Anyway, @Saancreed, I tested it on the same project as before, and it works. 😛

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