Re: Introducing KDE Activity Filter

2020-07-20 Thread Ingo Klöcker
On Sonntag, 19. Juli 2020 10:20:56 CEST Adriaan de Groot wrote:
> On Tuesday, 14 July 2020 10:57:41 CEST Ingo Klöcker wrote:
> > On Dienstag, 14. Juli 2020 10:20:33 CEST Kåre Särs wrote:
> > > Is there a way to verify that the yaml file is syntactically correct
> > > before
> > > pushing the change?
> > 
> > There are loads of YAML linters/validators, online and offline. In fact,
> > this would be an opportunity to test-drive the awesome GitLab CI/CD. I
> > volunteer to implement this, if sysadmin is okay with this.
> 
> There's a bunch of different tools for YAML validation indeed.

It has already been implemented and merged. I'm using the Python package 
yamllint.

> > Or do you mean "semantically correct", i.e. also checking for valid
> > projects?
> 
> (From a JSON-schema perspective) You might periodically generate a schema
> type that checks the repository-re, for the simple case of |-separated full
> repository names. Personally I'd be more inclined to follow Albert's
> original question, and change the tool not to eat a RE but a YAML
> list-of-repo-names.

I didn't implement any semantic validation. I agree that using a list would be 
more YAML-like.

Regards,
Ingo


signature.asc
Description: This is a digitally signed message part.


Re: Introducing KDE Activity Filter

2020-07-20 Thread Luiz Fernando Ranghetti
Hi Ben,

How to specify svn addresses?

Back in time I have pt_BR translations filtered in the old commit filter.
Then I could see the commits on phabricator, watching pages like this:
https://phabricator.kde.org/source/svn/history/branches/stable/l10n-kf5/pt_BR/
(and its trunk counterpart). I didn't find something similar to this on
invent.k.o

Now I'm left with this:
https://websvn.kde.org/branches/stable/l10n-kf5/pt_BR/messages/?sortby=date#dirlist
(in
this case scripty run will mask someone contribution)

Regards,

Luiz





Em dom., 12 de jul. de 2020 às 14:57, Ben Cooksley 
escreveu:

> On Mon, Jul 13, 2020 at 4:46 AM Albert Astals Cid  wrote:
> >
> > El diumenge, 12 de juliol de 2020, a les 8:08:11 CEST, Ben Cooksley va
> escriure:
> > > Hi all,
> > >
> > > A few years back Sysadmin had to turn off the old Commit Filter
> > > service due to a number of security issues, with no replacement
> > > available.
> > >
> > > I'm now happy to announce that a replacement service is now available,
> >
> > Very much appreciated! Now i can stop using ifttt :)
> >
> > > with the added functionality of also being able to cover activity on
> > > Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
> > > that Activity Filter will be used to provide Gitlab notifications for
> > > merge requests and tasks to mailing lists, along with CI notifications
> > > if desired (once that is moved to Gitlab)
> > >
> > > The new service is configured through YAML format files in the
> > > sysadmin/activityfilter repository
> > > (https://invent.kde.org/sysadmin/activityfilter), which is open to
> > > developers to commit. Please ensure that you read the README contained
> > > in the repository before doing so.
> > >
> > > Please let us know if you have any questions on the above!
> >
> > Can i do stuff like this?
> >
> > - name: "Commits"
> >   subscribes: "aa...@kde.org"
> >   to: commits
> >   where:
> > project: 'bla'
> > project: 'bla1'
> > project: 'bla2'
> > project: 'bla3'
> > project: 'bla4'
> > project: 'bla5'
> > project: 'bla6'
> > project: 'bla7'
> > project: 'bla8'
> >
> > ?
>
> I'm afraid rules like that aren't supported, however you can specify a
> regex so something like:
>
> where:
> project: 'foo1|foo2|foo3'
>
> should work fine.
>
> >
> > Cheers,
> >   Albert
> >
>
> Cheers,
> Ben
>
> >
> > >
> > > Thanks,
> > > Ben Cooksley
> > > KDE Sysadmin
> > >
> >
> >
> >
> >
>


Re: Introducing KDE Activity Filter

2020-07-19 Thread Adriaan de Groot
On Tuesday, 14 July 2020 10:57:41 CEST Ingo Klöcker wrote:
> On Dienstag, 14. Juli 2020 10:20:33 CEST Kåre Särs wrote:
> > Is there a way to verify that the yaml file is syntactically correct
> > before
> > pushing the change?
> 
> There are loads of YAML linters/validators, online and offline. In fact,
> this would be an opportunity to test-drive the awesome GitLab CI/CD. I
> volunteer to implement this, if sysadmin is okay with this.

There's a bunch of different tools for YAML validation indeed. "kwalify" was 
one, I think. With a name like that .. :) Unfortunately, lots of the tools are 
also unmaintained, as I found out when I went looking recently.

JSON-schema claims, though, to be maintained and applies to YAML and beyond 
(for those sensible cases where your YAML is a representation of JSON, and not 
the edge cases of what YAML can do).

For Calamares, which is chock-full of simple YAML files, I ended up bodging a 
tool together in Python where most of the code ends up being validation logic, 
followed by one call to the Python library `jsonschema`. There's probably 
other ready-to-go tools like it.

https://github.com/calamares/calamares/blob/calamares/ci/configvalidator.py

A typical schema file for JSON-schema can be represented in YAML as well 
(because YAML is JSON, or something). Here's one, which has some enums, 
handles a list, and also contains string and boolean settings:

https://github.com/calamares/calamares/blob/calamares/src/modules/welcome/
welcome.schema.yaml

> Or do you mean "semantically correct", i.e. also checking for valid
> projects?

(From a JSON-schema perspective) You might periodically generate a schema type 
that checks the repository-re, for the simple case of |-separated full 
repository names. Personally I'd be more inclined to follow Albert's original 
question, and change the tool not to eat a RE but a YAML list-of-repo-names.

[ade]

signature.asc
Description: This is a digitally signed message part.


Re: Introducing KDE Activity Filter

2020-07-15 Thread Ben Cooksley
On Tue, Jul 14, 2020 at 8:58 PM Ingo Klöcker  wrote:
>
> On Dienstag, 14. Juli 2020 10:20:33 CEST Kåre Särs wrote:
> > Is there a way to verify that the yaml file is syntactically correct before
> > pushing the change?
>
> There are loads of YAML linters/validators, online and offline. In fact, this
> would be an opportunity to test-drive the awesome GitLab CI/CD. I volunteer to
> implement this, if sysadmin is okay with this.

Please feel free to go ahead with this.

>
> Or do you mean "semantically correct", i.e. also checking for valid projects?

The best you could do is check to see if it is a valid regex (as
supported by procmail) I think, as otherwise regex rules such as
frameworks/.* would be considered invalid.

>
> Regards,
> Ingo

Thanks,
Ben


Re: Introducing KDE Activity Filter

2020-07-15 Thread Ben Cooksley
On Tue, Jul 14, 2020 at 8:21 PM Kåre Särs  wrote:
>
> On söndag 12 juli 2020 kl. 20:48:29 EEST Ben Cooksley wrote:
>
> > On Mon, Jul 13, 2020 at 4:46 AM Albert Astals Cid  wrote:
>
> > > El diumenge, 12 de juliol de 2020, a les 8:08:11 CEST, Ben Cooksley va 
> > > escriure:
>
> > > > Hi all,
>
> > > >
>
> > > > A few years back Sysadmin had to turn off the old Commit Filter
>
> > > > service due to a number of security issues, with no replacement
>
> > > > available.
>
> > > >
>
> > > > I'm now happy to announce that a replacement service is now available,
>
> > >
>
> > > Very much appreciated! Now i can stop using ifttt :)
>
>
> Very much appreciated! :)
>
>
>
> > >
>
> > > > with the added functionality of also being able to cover activity on
>
> > > > Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
>
> > > > that Activity Filter will be used to provide Gitlab notifications for
>
> > > > merge requests and tasks to mailing lists, along with CI notifications
>
> > > > if desired (once that is moved to Gitlab)
>
> > > >
>
> > > > The new service is configured through YAML format files in the
>
> > > > sysadmin/activityfilter repository
>
> > > > (https://invent.kde.org/sysadmin/activityfilter), which is open to
>
> > > > developers to commit. Please ensure that you read the README contained
>
> > > > in the repository before doing so.
>
> > > >
>
> > > > Please let us know if you have any questions on the above!
>
> > >
>
> > > Can i do stuff like this?
>
> > >
>
> > > - name: "Commits"
>
> > >
>
> > >   subscribes: "aa...@kde.org"
>
> > >   to: commits
>
> > >
>
> > >   where:
>
> > > project: 'bla'
>
> > > project: 'bla1'
>
> > > project: 'bla2'
>
> > > project: 'bla3'
>
> > > project: 'bla4'
>
> > > project: 'bla5'
>
> > > project: 'bla6'
>
> > > project: 'bla7'
>
> > > project: 'bla8'
>
> > >
>
> > > ?
>
> >
>
> > I'm afraid rules like that aren't supported, however you can specify a
>
> > regex so something like:
>
> >
>
> > where:
>
> > project: 'foo1|foo2|foo3'
>
> >
>
> > should work fine.
>
> >
>
>
> Is there a way to verify that the yaml file is syntactically correct before 
> pushing the change?

At this time i'm afraid there is nothing to validate the syntax of the
files pushed to the repository.

It will however skip any file that is invalid format wise when
generating the rules for use by procmail.

>
>
> Regards,
>
>   Kåre

Thanks,
Ben

>
>
>
> > > Cheers,
>
> > >
>
> > >   Albert
>
> >
>
> > Cheers,
>
> > Ben
>
> >
>
> > > > Thanks,
>
> > > > Ben Cooksley
>
> > > > KDE Sysadmin
>
>
>


Re: Introducing KDE Activity Filter

2020-07-14 Thread Ingo Klöcker
On Dienstag, 14. Juli 2020 10:20:33 CEST Kåre Särs wrote:
> Is there a way to verify that the yaml file is syntactically correct before
> pushing the change?

There are loads of YAML linters/validators, online and offline. In fact, this 
would be an opportunity to test-drive the awesome GitLab CI/CD. I volunteer to 
implement this, if sysadmin is okay with this.

Or do you mean "semantically correct", i.e. also checking for valid projects?

Regards,
Ingo


signature.asc
Description: This is a digitally signed message part.


Re: Introducing KDE Activity Filter

2020-07-14 Thread Kåre Särs
On söndag 12 juli 2020 kl. 20:48:29 EEST Ben Cooksley wrote:
> On Mon, Jul 13, 2020 at 4:46 AM Albert Astals Cid  wrote:
> > El diumenge, 12 de juliol de 2020, a les 8:08:11 CEST, Ben Cooksley va 
> > escriure:
> > > Hi all,
> > > 
> > > A few years back Sysadmin had to turn off the old Commit Filter
> > > service due to a number of security issues, with no replacement
> > > available.
> > > 
> > > I'm now happy to announce that a replacement service is now available,
> > 
> > Very much appreciated! Now i can stop using ifttt :)

Very much appreciated! :)


> > 
> > > with the added functionality of also being able to cover activity on
> > > Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
> > > that Activity Filter will be used to provide Gitlab notifications for
> > > merge requests and tasks to mailing lists, along with CI notifications
> > > if desired (once that is moved to Gitlab)
> > > 
> > > The new service is configured through YAML format files in the
> > > sysadmin/activityfilter repository
> > > (https://invent.kde.org/sysadmin/activityfilter), which is open to
> > > developers to commit. Please ensure that you read the README contained
> > > in the repository before doing so.
> > > 
> > > Please let us know if you have any questions on the above!
> > 
> > Can i do stuff like this?
> > 
> > - name: "Commits"
> > 
> >   subscribes: "aa...@kde.org"
> >   to: commits
> >   
> >   where:
> > project: 'bla'
> > project: 'bla1'
> > project: 'bla2'
> > project: 'bla3'
> > project: 'bla4'
> > project: 'bla5'
> > project: 'bla6'
> > project: 'bla7'
> > project: 'bla8'
> > 
> > ?
> 
> I'm afraid rules like that aren't supported, however you can specify a
> regex so something like:
> 
> where:
> project: 'foo1|foo2|foo3'
> 
> should work fine.
> 

Is there a way to verify that the yaml file is syntactically correct before 
pushing the change?

Regards,
  Kåre


> > Cheers,
> > 
> >   Albert
> 
> Cheers,
> Ben
> 
> > > Thanks,
> > > Ben Cooksley
> > > KDE Sysadmin




Re: Introducing KDE Activity Filter

2020-07-14 Thread Ben Cooksley
On Tue, Jul 14, 2020 at 1:50 AM Luiz Fernando Ranghetti
 wrote:
>
> Hi Ben,

Hi Luiz,

>
> How to specify svn addresses?
>
> Back in time I have pt_BR translations filtered in the old commit filter. 
> Then I could see the commits on phabricator, watching pages like this:
> https://phabricator.kde.org/source/svn/history/branches/stable/l10n-kf5/pt_BR/
>   (and its trunk counterpart). I didn't find something similar to this on 
> invent.k.o
>
> Now I'm left with this:
> https://websvn.kde.org/branches/stable/l10n-kf5/pt_BR/messages/?sortby=date#dirlist
>  (in this case scripty run will mask someone contribution)

At this time i'm afraid Subversion is not supported by the Activity
Filter service.

Adding such support would require adding a Subversion variant to the
rule generator, which can be found below.
https://invent.kde.org/sysadmin/repo-management/-/blob/master/activity-filter/procmailrcgenerator.py#L4

It should be reasonably straight forward to implement, however I lack
mail samples (with full headers preserved) that would be necessary to
implement this.

>
> Regards,
>
> Luiz
>

Regards,
Ben

>
>
>
>
> Em dom., 12 de jul. de 2020 às 14:57, Ben Cooksley  
> escreveu:
>>
>> On Mon, Jul 13, 2020 at 4:46 AM Albert Astals Cid  wrote:
>> >
>> > El diumenge, 12 de juliol de 2020, a les 8:08:11 CEST, Ben Cooksley va 
>> > escriure:
>> > > Hi all,
>> > >
>> > > A few years back Sysadmin had to turn off the old Commit Filter
>> > > service due to a number of security issues, with no replacement
>> > > available.
>> > >
>> > > I'm now happy to announce that a replacement service is now available,
>> >
>> > Very much appreciated! Now i can stop using ifttt :)
>> >
>> > > with the added functionality of also being able to cover activity on
>> > > Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
>> > > that Activity Filter will be used to provide Gitlab notifications for
>> > > merge requests and tasks to mailing lists, along with CI notifications
>> > > if desired (once that is moved to Gitlab)
>> > >
>> > > The new service is configured through YAML format files in the
>> > > sysadmin/activityfilter repository
>> > > (https://invent.kde.org/sysadmin/activityfilter), which is open to
>> > > developers to commit. Please ensure that you read the README contained
>> > > in the repository before doing so.
>> > >
>> > > Please let us know if you have any questions on the above!
>> >
>> > Can i do stuff like this?
>> >
>> > - name: "Commits"
>> >   subscribes: "aa...@kde.org"
>> >   to: commits
>> >   where:
>> > project: 'bla'
>> > project: 'bla1'
>> > project: 'bla2'
>> > project: 'bla3'
>> > project: 'bla4'
>> > project: 'bla5'
>> > project: 'bla6'
>> > project: 'bla7'
>> > project: 'bla8'
>> >
>> > ?
>>
>> I'm afraid rules like that aren't supported, however you can specify a
>> regex so something like:
>>
>> where:
>> project: 'foo1|foo2|foo3'
>>
>> should work fine.
>>
>> >
>> > Cheers,
>> >   Albert
>> >
>>
>> Cheers,
>> Ben
>>
>> >
>> > >
>> > > Thanks,
>> > > Ben Cooksley
>> > > KDE Sysadmin
>> > >
>> >
>> >
>> >
>> >


Re: Introducing KDE Activity Filter

2020-07-12 Thread Ben Cooksley
On Mon, Jul 13, 2020 at 4:46 AM Albert Astals Cid  wrote:
>
> El diumenge, 12 de juliol de 2020, a les 8:08:11 CEST, Ben Cooksley va 
> escriure:
> > Hi all,
> >
> > A few years back Sysadmin had to turn off the old Commit Filter
> > service due to a number of security issues, with no replacement
> > available.
> >
> > I'm now happy to announce that a replacement service is now available,
>
> Very much appreciated! Now i can stop using ifttt :)
>
> > with the added functionality of also being able to cover activity on
> > Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
> > that Activity Filter will be used to provide Gitlab notifications for
> > merge requests and tasks to mailing lists, along with CI notifications
> > if desired (once that is moved to Gitlab)
> >
> > The new service is configured through YAML format files in the
> > sysadmin/activityfilter repository
> > (https://invent.kde.org/sysadmin/activityfilter), which is open to
> > developers to commit. Please ensure that you read the README contained
> > in the repository before doing so.
> >
> > Please let us know if you have any questions on the above!
>
> Can i do stuff like this?
>
> - name: "Commits"
>   subscribes: "aa...@kde.org"
>   to: commits
>   where:
> project: 'bla'
> project: 'bla1'
> project: 'bla2'
> project: 'bla3'
> project: 'bla4'
> project: 'bla5'
> project: 'bla6'
> project: 'bla7'
> project: 'bla8'
>
> ?

I'm afraid rules like that aren't supported, however you can specify a
regex so something like:

where:
project: 'foo1|foo2|foo3'

should work fine.

>
> Cheers,
>   Albert
>

Cheers,
Ben

>
> >
> > Thanks,
> > Ben Cooksley
> > KDE Sysadmin
> >
>
>
>
>


Re: Introducing KDE Activity Filter

2020-07-12 Thread Albert Astals Cid
El diumenge, 12 de juliol de 2020, a les 8:08:11 CEST, Ben Cooksley va escriure:
> Hi all,
> 
> A few years back Sysadmin had to turn off the old Commit Filter
> service due to a number of security issues, with no replacement
> available.
> 
> I'm now happy to announce that a replacement service is now available,

Very much appreciated! Now i can stop using ifttt :)

> with the added functionality of also being able to cover activity on
> Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
> that Activity Filter will be used to provide Gitlab notifications for
> merge requests and tasks to mailing lists, along with CI notifications
> if desired (once that is moved to Gitlab)
> 
> The new service is configured through YAML format files in the
> sysadmin/activityfilter repository
> (https://invent.kde.org/sysadmin/activityfilter), which is open to
> developers to commit. Please ensure that you read the README contained
> in the repository before doing so.
> 
> Please let us know if you have any questions on the above!

Can i do stuff like this?

- name: "Commits"
  subscribes: "aa...@kde.org"
  to: commits
  where:
project: 'bla'
project: 'bla1'
project: 'bla2'
project: 'bla3'
project: 'bla4'
project: 'bla5'
project: 'bla6'
project: 'bla7'
project: 'bla8'

?

Cheers,
  Albert


> 
> Thanks,
> Ben Cooksley
> KDE Sysadmin
> 






Introducing KDE Activity Filter

2020-07-12 Thread Ben Cooksley
Hi all,

A few years back Sysadmin had to turn off the old Commit Filter
service due to a number of security issues, with no replacement
available.

I'm now happy to announce that a replacement service is now available,
with the added functionality of also being able to cover activity on
Bugzilla and Gitlab (for Tasks and Merge Requests). It is intended
that Activity Filter will be used to provide Gitlab notifications for
merge requests and tasks to mailing lists, along with CI notifications
if desired (once that is moved to Gitlab)

The new service is configured through YAML format files in the
sysadmin/activityfilter repository
(https://invent.kde.org/sysadmin/activityfilter), which is open to
developers to commit. Please ensure that you read the README contained
in the repository before doing so.

Please let us know if you have any questions on the above!

Thanks,
Ben Cooksley
KDE Sysadmin