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

Package dmarc-srg into Debian #154

Closed
williamdes opened this issue Jan 24, 2025 · 20 comments
Closed

Package dmarc-srg into Debian #154

williamdes opened this issue Jan 24, 2025 · 20 comments

Comments

@williamdes
Copy link
Contributor

williamdes commented Jan 24, 2025

This is so much of a great tool and I can not donate, that I can only propose to make it enter Debian.

What does it require:

@liuch do you have any observations ?

I found no ITP in https://wnpp.debian.net/ so I will file a new one: Done, here it is https://bugs.debian.org/1094136

The packaging will take place in https://salsa.debian.org/php-team/pear/dmarc-srg

@liuch
Copy link
Owner

liuch commented Jan 24, 2025

Thank you for your attention to my project! I appreciate that.
As for my observations: the last two dependencies are only needed if S3 storage is used. Are any additional actions required of me?

BTW: Some time ago I was surprised to discover that DmarcSrg is used in NetBSD.

@williamdes
Copy link
Contributor Author

Thank you for your attention to my project! I appreciate that.

It is really cool, and Debian has no such tool.
The tech is perfectly clean, I love using dmarc-srg as you can feel in the interfaces that there is no JS dependencies or large vendors to load.

As for my observations: the last two dependencies are only needed if S3 storage is used. Are any additional actions required of me?

Okay, perfect. That is what I had in mind.
I will set them as suggested dependencies.

I did notice your copyright on the files is 2020 but the first commit it 2021. Is 2020 the right year for the start of your copyright ?

BTW: Some time ago I was surprised to discover that DmarcSrg is used in NetBSD.

Oh cool !
https://repology.org/project/php%3Admarc-srg/versions

@williamdes
Copy link
Contributor Author

You seem to have phpunit tests, is there a reason to not use GitHub actions to run them ?

@williamdes
Copy link
Contributor Author

Do you use Debian or Ubuntu ?
I mean, to test dmarc-srg once I finish the packaging.

@liuch
Copy link
Owner

liuch commented Jan 24, 2025

I did notice your copyright on the files is 2020 but the first commit it 2021. Is 2020 the right year for the start of your copyright ?

Project started in 2020 and only used on my personal server. In January 2021, I put it online.

You seem to have phpunit tests, is there a reason to not use GitHub actions to run them ?

For now, I see no reason to use Github actions as long as the same tests I can run on my local computer. Maybe later.

Do you use Debian or Ubuntu ?
I mean, to test dmarc-srg once I finish the packaging.

I use Debian (trixie).

@williamdes
Copy link
Contributor Author

For now, I see no reason to use Github actions as long as the same tests I can run on my local computer. Maybe later.

Okay, for information I will run your tests in debian. They call it autopkgtests.
And will probably add some selenium tests to ensure the package works

I use Debian (trixie).

Awesome, you will have the package first then!

@williamdes
Copy link
Contributor Author

williamdes commented Jan 24, 2025

I will have to patch the software to move the path of config/conf.php to /etc/dmarc-srg/conf.php
Can we have in future versions a constant for all the project ?
init.php seems to be ready for this.

At phpMyAdmin we have a vendor_config file to help maintaining such patches: https://github.com/phpmyadmin/phpmyadmin/blob/master/app/vendor_config.php

Edit: I am not sure why but only the Apache2 logs indicate that the file is missing. Maybe some lines to print a message could work ?

@williamdes
Copy link
Contributor Author

I tried running the tests, and phpunit 11 (version in Debian) is unhappy about all the mocks..

But this 3 ones are easy to fix with zero impacts:

1) Liuch\DmarcSrg\UserTest::testLevelToStringCorrectValue
The data provider specified for Liuch\DmarcSrg\UserTest::testLevelToStringCorrectValue is invalid
Data Provider method Liuch\DmarcSrg\UserTest::dataProvider1() is not static

/mnt/Dev/@debian/@wdes-packaging-team/dmarc-srg/tests/classes/Users/UserTest.php:26

2) Liuch\DmarcSrg\UserTest::testLevelToStringIncorrectValue
The data provider specified for Liuch\DmarcSrg\UserTest::testLevelToStringIncorrectValue is invalid
Data Provider method Liuch\DmarcSrg\UserTest::dataProvider1() is not static

/mnt/Dev/@debian/@wdes-packaging-team/dmarc-srg/tests/classes/Users/UserTest.php:34

3) Liuch\DmarcSrg\UserTest::testStringToLevelCorrectValue
The data provider specified for Liuch\DmarcSrg\UserTest::testStringToLevelCorrectValue is invalid
Data Provider method Liuch\DmarcSrg\UserTest::dataProvider1() is not static

/mnt/Dev/@debian/@wdes-packaging-team/dmarc-srg/tests/classes/Users/UserTest.php:46

liuch added a commit that referenced this issue Jan 25, 2025
@liuch
Copy link
Owner

liuch commented Jan 25, 2025

I will have to patch the software to move the path of config/conf.php to /etc/dmarc-srg/conf.php
Can we have in future versions a constant for all the project ?

Done.

@liuch
Copy link
Owner

liuch commented Jan 25, 2025

Edit: I am not sure why but only the Apache2 logs indicate that the file is missing. Maybe some lines to print a message could work ?

Do you mean that information about unavailability of the configuration file should be output not only to the log, but also to the browser / console?

I tried running the tests, and phpunit 11 (version in Debian) is unhappy about all the mocks..

Unfortunately, phpunit is currently broken in my debian instance, I can't check and fix the tests right now. I'm waiting for update for phpunit from Debian team.

liuch added a commit that referenced this issue Jan 25, 2025
@williamdes
Copy link
Contributor Author

I will have to patch the software to move the path of config/conf.php to /etc/dmarc-srg/conf.php
Can we have in future versions a constant for all the project ?

Done.

Thank you, it looks good !

Ref: b459815 also to fix it

@williamdes
Copy link
Contributor Author

Do you mean that information about unavailability of the configuration file should be output not only to the log, but also to the browser / console?

Yes indeed, the browser was missing that indication.

Unfortunately, phpunit is currently broken in my debian instance, I can't check and fix the tests right now. I'm waiting for update for phpunit from Debian team.

What do you mean, do you use the version in testing or unstable ?
What is the current error ?

@liuch
Copy link
Owner

liuch commented Jan 27, 2025

Yes indeed, the browser was missing that indication.

That makes sense. But only if the current user is admin. For other users, display something else, I think.

@liuch
Copy link
Owner

liuch commented Jan 27, 2025

What do you mean, do you use the version in testing or unstable ?
What is the current error ?

Trixie, the latest version.

$ phpunit --version
PHPUnit 11.5.3 by Sebastian Bergmann and contributors.

$ tests/run.sh 
PHPUnit 11.5.3 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.27

EEEEEEEE....................E.......E.D..EEEEE...EEFFFEFEEEEEEE  63 / 188 ( 33%)
EEE..........EEEF.EEEEEEEEEEEEEFEEEFFEEEEFEEEFFFEEEE........... 126 / 188 ( 67%)
....................EEEEEEEEEEFFEEFFFEEEEEEEEEEEEE............  188 / 188 (100%)

An error occurred inside PHPUnit.

Message:  file_put_contents(/usr/bin/.phpunit.result.cache): Failed to open stream: Permission denied
Location: /usr/share/php/PHPUnit/Runner/ResultCache/DefaultResultCache.php:160

#0 [internal function]: PHPUnit\TextUI\Application->{closure}()
#1 /usr/share/php/PHPUnit/Runner/ResultCache/DefaultResultCache.php(160): file_put_contents()
#2 /usr/share/php/PHPUnit/Runner/ResultCache/ResultCacheHandler.php(60): PHPUnit\Runner\ResultCache\DefaultResultCache->persist()
#3 /usr/share/php/PHPUnit/Runner/ResultCache/Subscriber/TestSuiteFinishedSubscriber.php(24): PHPUnit\Runner\ResultCache\ResultCacheHandler->testSuiteFinished()
#4 /usr/share/php/PHPUnit/Event/Dispatcher/DirectDispatcher.php(106): PHPUnit\Runner\ResultCache\TestSuiteFinishedSubscriber->notify()
#5 /usr/share/php/PHPUnit/Event/Dispatcher/DeferringDispatcher.php(47): PHPUnit\Event\DirectDispatcher->dispatch()
#6 /usr/share/php/PHPUnit/Event/Emitter/DispatchingEmitter.php(1194): PHPUnit\Event\DeferringDispatcher->dispatch()
#7 /usr/share/php/PHPUnit/Framework/TestSuite.php(374): PHPUnit\Event\DispatchingEmitter->testSuiteFinished()
#8 /usr/share/php/PHPUnit/TextUI/TestRunner.php(64): PHPUnit\Framework\TestSuite->run()
#9 /usr/share/php/PHPUnit/TextUI/Application.php(210): PHPUnit\TextUI\TestRunner->run()
#10 /usr/bin/phpunit(104): PHPUnit\TextUI\Application->run()

This may be because I haven't updated php to the latest version yet.

@williamdes
Copy link
Contributor Author

This may be because I haven't updated php to the latest version yet.

Nevermind this, there is two ways

  • add a path to cache in phpunit.xml.dist
  • use --do-not-cache-results

It will not go away by itself, this is new in phpunit
and occurs aspecially when you do not have a phpunit config file

@liuch
Copy link
Owner

liuch commented Jan 27, 2025

Thank you for information. --do-not-cache-result worked out. Many other errors appeared. Looks like a lot of changes have been made in the new version of phpunit. I'll need to read the documentation.

liuch added a commit that referenced this issue Jan 27, 2025
@liuch
Copy link
Owner

liuch commented Jan 27, 2025

Done.

$ tests/run.sh 
PHPUnit 11.5.3 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.27

...............................................................  63 / 188 ( 33%)
............................................................... 126 / 188 ( 67%)
..............................................................  188 / 188 (100%)

Time: 00:01.116, Memory: 12.00 MB

OK (188 tests, 639 assertions)

@williamdes
Copy link
Contributor Author

I am amazed, this got to Debian FTP masters that did review it directly.
And it got accepted ! 🎉
Congratulations, you are in Debian ! Soon it will auto sync into Ubuntu and other derivatives.

Tracking (will look better tomorrow): https://tracker.debian.org/pkg/dmarc-srg

@liuch
Copy link
Owner

liuch commented Jan 29, 2025

That's great news. When I decided to put my project on the web, I assumed that few people would use it because of its simplicity and specificity of use. Of course, I didn't even think it would be considered worthy of use in Debian. I'm impressed! Thank you so much!

@williamdes
Copy link
Contributor Author

That's great news. When I decided to put my project on the web, I assumed that few people would use it because of its simplicity and specificity of use. Of course, I didn't even think it would be considered worthy of use in Debian. I'm impressed! Thank you so much!

It's simplicity is one of the first key points of your work. It just works💯
users love it 😍
No promises but maybe i can get it to Debian bookworm-backports.

Please check the security tab of github and write a policy to help future researchers 😉

I will write a blog post about your incredible tool some time soon

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

No branches or pull requests

2 participants