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

Cleanup files.PublishedStorage after dropping a publish #1381

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aol-nnov
Copy link
Contributor

@aol-nnov aol-nnov commented Oct 22, 2024

Fixes: #198

After dropping files.PublishedStorage there were some leftovers - empty directory tree. If that directory tree is empty, it is now removed.

Checklist

  • functional test added/updated (if change is functional)

@aol-nnov
Copy link
Contributor Author

@neolynx here is another annoying thing I'd like to fix in aptly. My publish prefix is bloated with empty directories as I have to create and remove publishes intensively.

@neolynx
Copy link
Member

neolynx commented Oct 22, 2024

oh, yes please ! I found this quite annoying as well...

@aol-nnov
Copy link
Contributor Author

yay, there is an issue for it! #198

files/public.go Outdated Show resolved Hide resolved
deb/publish.go Outdated Show resolved Hide resolved
@aol-nnov aol-nnov requested a review from neolynx October 22, 2024 14:44
@neolynx neolynx self-assigned this Oct 22, 2024
@neolynx neolynx added the fix tests Tests are failing label Oct 22, 2024
@aol-nnov aol-nnov force-pushed the cleanup-local-tree branch 2 times, most recently from d5f937b to 6809929 Compare October 23, 2024 06:32
@aol-nnov
Copy link
Contributor Author

aol-nnov commented Oct 23, 2024

@neolynx original tests that were failing are now fixed, but my newly added PublishDrop21Test is failing, not sure why...

May be it's time for me to learn something new, too? 😁 This alienish test suite is driving me nuts, frankly...

system/t06_publish/drop.py Outdated Show resolved Hide resolved
files/public.go Outdated Show resolved Hide resolved
@aol-nnov aol-nnov force-pushed the cleanup-local-tree branch 3 times, most recently from 05f0908 to 3b33303 Compare October 23, 2024 07:22
@aol-nnov
Copy link
Contributor Author

All tests are passing now

@neolynx
Copy link
Member

neolynx commented Oct 23, 2024

@neolynx original tests that were failing are now fixed

great ! could you explain why they failed ?

but my newly added PublishDrop21Test is failing, not sure why...

May be it's time for me to learn something new, too? 😁 This alienish test suite is driving me nuts, frankly...

please do not judge :) the history of all of this is in git, many people worked on that. I think the thing to learn here is how to deal with legacy code and how to slowly improve it and revive the project. so please be respectful and constructive, we are all aware of the state of things, and it took months to get it to a working and halfway reliable state.

@aol-nnov
Copy link
Contributor Author

aol-nnov commented Oct 23, 2024

could you explain why they failed ?

-gold file was missing for my PublishDrop21Test - copied it from PublishDrop2Test. Not completely sure what it is.

Whole experience of adding tests is cumbersome and non-obvious due to lack of developers documentation. Even some doc links to the testing frameworks would make the whole process more friendly and smooth...

Oh, and original tests were failing because checks relied on empty directories now removed (as you said, the history of all of this is in git :-) )

@neolynx
Copy link
Member

neolynx commented Oct 23, 2024

could you explain why they failed ?

-gold file was missing for my PublishDrop21Test - copied it from PublishDrop2Test. Not completely sure what it is.

ok great. in the Makefile there is the CAPTURE flag, you can uncomment, then the tests will create the gold files.

Whole experience of adding tests is cumbersome and non-obvious due to lack of developers documentation. Even some doc links to the testing frameworks would make the whole process more friendly and smooth...

as said before, we are well aware of that. feel free to contribute. until then let's keep the discussions here technical.

Oh, and original tests were failing because checks relied on empty directories now removed (as you said, the history of all of this is in git :-) )

thanks, that is excellent :-)

@aol-nnov aol-nnov force-pushed the cleanup-local-tree branch 3 times, most recently from ab0c5e5 to 81d0034 Compare October 23, 2024 08:50
@neolynx
Copy link
Member

neolynx commented Oct 23, 2024

tests look good !

I started a coverage build: codecov/patch — 84.61% of diff hit (target 74.84%)

@aol-nnov aol-nnov force-pushed the cleanup-local-tree branch 2 times, most recently from 5750df4 to ddc84c5 Compare October 23, 2024 09:01
@aol-nnov
Copy link
Contributor Author

Seems, ci is stuck again...

@neolynx
Copy link
Member

neolynx commented Oct 23, 2024

Seems, ci is stuck again...

seems we have a segfault:
https://github.com/aptly-dev/aptly/actions/runs/11476603052/job/31936962068?pr=1381#step:8:487

@aol-nnov
Copy link
Contributor Author

aol-nnov commented Oct 23, 2024

seems we have a segfault

Heh, that's because nil is passed instead of aptly.Progress in tests. Very handy 😒

P.S.: handled that on my side

@aol-nnov
Copy link
Contributor Author

Now, seems -gold-en outputs do not match new reality 😂

@neolynx
Copy link
Member

neolynx commented Oct 23, 2024

Now, seems -gold-en outputs do not match new reality 😂

it needs that non empty check before remove... ;-)

@aol-nnov
Copy link
Contributor Author

Also, something wrong with docker tests:

$ make docker-image
[+] Building 310.3s (21/21) FINISHED
$ make docker-system-test
usermod: UID '0' already exists
make: *** [docker-system-test] Error 4
$ _

So, for me there is no simple way to update test now, unfortunately.

@aol-nnov
Copy link
Contributor Author

it needs that non empty check before remove... ;-)

You know what, my experience contributing in this particular PR is drastically falling down. Second day in a row we're chewing through tons of comments in a changeset that barely changes nothing, docs on testsuite are missing, tooling does not work and you're making jokes on me...

That all really makes me sad.

@neolynx
Copy link
Member

neolynx commented Oct 23, 2024

Also, something wrong with docker tests:

the docker-wrapper sets the user to the one of the git repo directory, to not write files as root. it seems your git dir is owned by root. changing to user owner would solve this in that case.

@aol-nnov
Copy link
Contributor Author

aol-nnov commented Oct 23, 2024

it seems your git dir is owned by root

not true

$ ls -lad ../aptly/
drwxr-xr-x@ 46 aol  staff  1472 Oct 22 17:22 ../aptly/

Thanks for the docker-wrapper idea, though. Slashed it a bit.

@aol-nnov
Copy link
Contributor Author

Re: better tooling #1384

It might be worth merging it first.

@aol-nnov aol-nnov requested a review from neolynx October 24, 2024 07:27
@aol-nnov
Copy link
Contributor Author

aol-nnov commented Oct 28, 2024

A friendly ping for @neolynx

Tests are fixed now.

Let's finish those two PRs, we're on the homestretch ;)

@aol-nnov

This comment was marked as resolved.

After dropping files.PublishedStorage there were some leftovers -
empty directory tree. If that directory tree is empty, it is now removed.

Fixes: aptly-dev#198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix tests Tests are failing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aptly leave empty directory structure when droping published repo with prefix
2 participants