This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new e2c75e0  add a posting API for reporter.apache.org
e2c75e0 is described below

commit e2c75e0684ac89bf9bfa2119e03d4afe690fab55
Author: Sam Ruby <[email protected]>
AuthorDate: Fri Aug 2 11:49:01 2019 -0400

    add a posting API for reporter.apache.org
---
 www/board/agenda/views/actions/post.json.rb | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/www/board/agenda/views/actions/post.json.rb 
b/www/board/agenda/views/actions/post.json.rb
index e59cb78..f5f1351 100644
--- a/www/board/agenda/views/actions/post.json.rb
+++ b/www/board/agenda/views/actions/post.json.rb
@@ -14,6 +14,18 @@ Agenda.update(@agenda, @message) do |agenda|
   # quick parse of agenda
   parsed = ASF::Board::Agenda.parse(agenda, true)
 
+  # map @project to @attach to support posting from reporter.apache.org
+  if not @attach and @project
+    project = ASF::Committee.find(@project).display_name
+    parsed.each do |report|
+      if report['title'] == project
+        raise "report already posted" unless report['missing']
+        @attach = report[:attach]
+        @digest = report['digest']
+      end
+    end
+  end
+
   # remove trailing whitespace
   @report.sub! /\s*\Z/, ''
 

Reply via email to