Simplify announcement submission
Open, Needs TriagePublic

Description

From @dfaure in the thread with subject: do you need www.kde.org write access?

I need to be able to do these things in an AUTOMATED manner, which was very
easy to do with PHP files in SVN, my scripts were adding everything
automatically. I am not looking forward to having to change those scripts but
I understand the necessity. However is it actually possible to automate
changes with wordpress, at all?

apol created this task.Apr 4 2018, 3:33 PM
ngraham added a subscriber: ngraham.Apr 4 2018, 5:19 PM

I ported my Plasma script to post to wordpress but it's not yet well tested
https://cgit.kde.org/releaseme.git/tree/plasma/plasma-webpages-wordpress

I've got a Wordpress site which nobody reads, so I don't mind abusing it by testing your script. As long as you can reassure me I won't inadvertently upload tarballs to your server or submit gibberish to a KDE site or repo... I'm not well-versed in Ruby, but I think I can sort out any bits that might do harm to me, my system, KDE, or innocent bystanders.

apol added a subscriber: aacid.Apr 8 2018, 10:07 PM

@aacid and @dfaure, can you maybe see if that would help with KDE Applications and KDE Frameworks releases respectively?

aacid added a subscriber: cfeck.Apr 8 2018, 11:43 PM

Personally i don't really have big requirements, since i do all the releases by just copy&pasting the old releases manually. I guess i could do the same thing on the webpage.

Looking at @jriddell script and without being a ruby reader i see it seems to create the announcement page, the changelog page and the info page.

That still leaves the main page and the announcements index to be updated, which are a bit more tricky because it involves modifying existing webpages instead of creating new ones.

Adding @cfeck since he's done 4 out of the last 6 releases of the KDE Applications, so he's voice is more important than mine :)

Wordpress *and* ruby, way out of my comfort zone.
Can someone look into porting the current script?
git clone git@git.kde.org:sysadmin/release-tools -b frameworks/5.0
then read create_sources_inc and look for svn

@aacid, @cfeck, don't you generate "source*.inc" files with sha1 sums, as we used to do?

cfeck added a comment.Apr 14 2018, 2:18 PM

For the previous release I made (18.03.90), I was still able to commit the sources.inc to svn for the announcement. If this has changed, I would need a tutorial to follow, because my experience with Wordpress is void.

apol added a comment.May 25 2018, 4:21 PM
In T8425#137515, @aacid wrote:

Looking at @jriddell script and without being a ruby reader i see it seems to create the announcement page, the changelog page and the info page.

Considering the design as is in current kde.org and https://www-backstage.kde.org/, it looks like just putting these posts on a specific category and then listing the RSS of the category (like we are already showing some) or listing the category if WP can do that should be enough, no need to modify a page every time.

Wordpress *and* ruby, way out of my comfort zone.
Can someone look into porting the current script?
git clone git@git.kde.org:sysadmin/release-tools -b frameworks/5.0
then read create_sources_inc and look for svn

Will look into it.

apol added a comment.May 28 2018, 2:46 PM

Looked into it, turned the wordpress code in releaseme into something we can also use from the command line: https://cgit.kde.org/releaseme.git/tree/plasma/cliwordpress.rb

Usage: cliwordpress.rb [options]
        --title [title]              the page title
        --path [path]                the page path
        --body [contents]            the page contents
        --bodyfile [path]            the page contents path
        --categories [categories]    the page categories, separed by ',' coma
        --tags [tags]                the page tags, separed by ',' coma

With it, we could have such lines in the release-tools scripts:

diff --git a/create_sources_inc b/create_sources_inc
index b750b86..77af2dc 100755
--- a/create_sources_inc
+++ b/create_sources_inc
@@ -118,6 +118,7 @@ echo '</table>' >> $output
 
 cd `dirname $output`
 svn add `basename $output`
+./cliwordpress.rb --title "KDE Frameworks $onlyversion" --path "info-kde-frameworks-$version" --bodyfile "`basename $output`" --tags kdeframeworks --categories ChangeLogs
 
 if [ -n "$onlyversion" ]; then
     exit 0
@@ -154,6 +155,7 @@ perl -pi -e "s/INSERT_DATE_HERE/$date/" kde-frameworks-$version.php
 perl -pi -e "s/DIRECTORY/$dir/" kde-frameworks-$version.php
 
 svn add kde-frameworks-$version.php
+./cliwordpress.rb --title "KDE Frameworks $onlyversion Announcement" --path "announce-kde-frameworks-$version" --bodyfile "`basename $output`" --tags kdeframeworks --categories Announcements
 
 ########
 # Output lines for announcements/index.php

Of course we could eventually remove the svn code too and some headers and footers from the file, it's just to get an idea.
I'm not even sure if I did it right but I guess you get the gist.

Does that make sense to you?
What would be the correct way to share the code between both modules?