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

Fix 'conan remove': output only confirmed entries #14478

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

Tobulus
Copy link
Contributor

@Tobulus Tobulus commented Aug 14, 2023

Changelog: Bugfix: 'conan remove' was outputting all entries in the cache matching the filter not just the once which where confirmed by the user.
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

@CLAassistant
Copy link

CLAassistant commented Aug 14, 2023

CLA assistant check
All committers have signed the CLA.

@Tobulus Tobulus force-pushed the fix_remove_output branch from baf5943 to f33a5a7 Compare August 14, 2023 19:18
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @Tobulus, it is looking good.
It would be necessary to add a unit test, to guarantee that this is not broken in the future. Do you think you could add it, or need some help with that?

@memsharded memsharded added this to the 2.0.10 milestone Aug 15, 2023

results_pkg_list = PackagesList()
results = MultiPackagesList()
Copy link
Member

Choose a reason for hiding this comment

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

You cannot just recreate the lists here, unconditionally, because this discard the information in the above multi_package_list? A lot of tests in https://ci.conan.io/blue/organizations/jenkins/ConanTestSuitev2/detail/PR-14478/2/pipeline/36 are broken, please have a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the idea was to use multi_package_list only for iterating the stuff possible to be removed by the pattern and collect what was confirmed by the user in a separate list.

I'll take a look at the failing tests.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, that makes sense, now I see the add_xxx calls and less failing tests.
I am facing a similar problem in my "upload" branch (I am preparing the same fix for the upload command), and I have done something similar.
The issue with this is that it is missing the package_id configuration description. Don't worry about it, it is fine, I will revisit this myself when finishing the upload PR, I might change the API a bit for PackageLists to help with this.

@AbrilRBS
Copy link
Member

Hi! Thanks a lot for your PR. Quick question, as I'm afk right now and cant check by myself:

conan upload also has confirmation logic. Does the same issue also arise there?

@Tobulus Tobulus force-pushed the fix_remove_output branch from f33a5a7 to c49900f Compare August 15, 2023 18:22
@Tobulus
Copy link
Contributor Author

Tobulus commented Aug 15, 2023

Thanks for the fix @Tobulus, it is looking good. It would be necessary to add a unit test, to guarantee that this is not broken in the future. Do you think you could add it, or need some help with that?

Let me take a look, I try to add testing. If I need help, I will ask. Thanks!

@Tobulus
Copy link
Contributor Author

Tobulus commented Aug 15, 2023

Thanks for the fix @Tobulus, it is looking good. It would be necessary to add a unit test, to guarantee that this is not broken in the future. Do you think you could add it, or need some help with that?

Should this be a unittest? Or can I add a test case here?

@Tobulus
Copy link
Contributor Author

Tobulus commented Aug 15, 2023

Hi! Thanks a lot for your PR. Quick question, as I'm afk right now and cant check by myself:

conan upload also has confirmation logic. Does the same issue also arise there?

Looks like the same problem there. Maybe we should fix that in a separate PR?

@memsharded
Copy link
Member

Looks like the same problem there. Maybe we should fix that in a separate PR?

Yes, I think it is worth doing the upload in a separate PR, as there is some stuff there we need to discuss regarding the UploadAPI and how the package_lists are managed in the API. I will create a ticket dedicated from it from this comment.

@Tobulus
Copy link
Contributor Author

Tobulus commented Aug 16, 2023

@memsharded The last failing test case actually revealed another problem, if I understand correctly.
This test case was passing before but was not actually doing what it is outputting.

This outputs that some binaries are deleted, but if you step through it with the debugger, this is not actually done (which now pops up as the output is corrected).

The problem seems this part which is not providing elements for iteration.

I don't understand the datastructure completly to tell why the iterator is empty ... can you help out?

If its helpful I can still provide a test case. As asked above: is it ok to not provide a unit test but a integration test?

@memsharded
Copy link
Member

Yes, it is possible that some tests are incorrect/buggy too, and those should be fixed. But there are too many tests broken, that typically means that there is something that is actually breaking valid working behavior.

If its helpful I can still provide a test case. As asked above: is it ok to not provide a unit test but a integration test?

yes, integration tests are usually our preferred choice for most tests.

@Tobulus
Copy link
Contributor Author

Tobulus commented Aug 17, 2023

Yes, it is possible that some tests are incorrect/buggy too, and those should be fixed. But there are too many tests broken, that typically means that there is something that is actually breaking valid working behavior.

If its helpful I can still provide a test case. As asked above: is it ok to not provide a unit test but a integration test?

yes, integration tests are usually our preferred choice for most tests.

2 failed, 1821 passed

I think you looked at the old test run? I force pushed one commit which I forgot, so there is no newer commit visible.

@memsharded
Copy link
Member

Yes, my bad, I hadn't realize about the new commits and new test run, looking better.

Sure, you can fix the tests and include them in the PR.

@memsharded
Copy link
Member

The PR #14512 for fixing the conan upload output has been merged.

Finally no API has changed, no new methods in PackagesList.

Please let me know if you would like a hand with this PR or you can manage to fix the tests.

@Tobulus
Copy link
Contributor Author

Tobulus commented Aug 21, 2023

The PR #14512 for fixing the conan upload output has been merged.

Finally no API has changed, no new methods in PackagesList.

Please let me know if you would like a hand with this PR or you can manage to fix the tests.

I'm out for the next two weeks. So I would be happy for help.

@memsharded memsharded merged commit 5e2b861 into conan-io:release/2.0 Aug 28, 2023
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.

4 participants