emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: sebastian_rose@gmx.de
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: worg for bug reports and feature requests was: (Regression testing for org-mode)
Date: Fri, 24 Oct 2008 13:44:31 -0700	[thread overview]
Message-ID: <87ljwd4tao.fsf@gmail.com> (raw)
In-Reply-To: <4901D7E3.1060809@gmx.de> (Sebastian Rose's message of "Fri, 24 Oct 2008 16:12:51 +0200")

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

Sebastian Rose <sebastian_rose@gmx.de> writes:

> And, the list is, what everyone reads. Sometimes new people show up,
> read about a bug and provide patches. Why 'hide' the bugs somewhere?
>

Point taken, the list has worked very well, and there is probably no
need to change it.

That said I couldn't help myself... and implemented a very simple little
web-form which can accept error reports, and append them to a "bugs.org"
org-file.  This gives every new report it's own headline in the outline,
uses TODO keywords to track the status of the report, uses properties to
track information such as the type of the report, and who is responsible
for completion, and it comments out the users input using the "^: "
syntax, to thwart any malicious inputs.  I know, I know, we should use a
mature bug tracking system or none at all, but org seems so well suited,
and this is so small.  How much trouble could it cause? :)

> Where will such a system live?
> Who installs and maintains it?

also, this solves the above problems, because if such a page were to
live as part of worg, then the resulting bugs.org files could live in
the worg git repo, and be maintained by worgers...

Thanks -- Eric

The attached mini-web-application is a ruby "camping" application, it
will build and maintain a bug file named "bugs.org" in the same
directory the script is located in.


[-- Attachment #2: org_bugs.rb --]
[-- Type: application/octet-stream, Size: 3198 bytes --]

#!/usr/bin/env ruby
require 'rubygems'
require 'camping'
## Setup
Camping.goes :OrgBugs
ORG_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "bugs.org")
DAYS_OF_THE_WEEK = %w[Sun Mon Tue Wed Thu Fri Sat] 

## Views
module OrgBugs::Views
  def index
    html do
      head do
        title "Org-Mode Bug Reports and Feature Requests"
        style "label {font-weight: bold;}"
      end
      body do
        h2 "Org-Mode Bug Reports and Feature Requests"
        form(:action => "submit", :method => "post", :enctype => "multipart/form-data") do
          p do
            label "Title (required) "
            input({:name => "title", :id => "title", :type => 'text_field', :size => 52})
            br
            label "Name (required)"
            input({:name => "name", :id => "name", :type => 'text_field', :size => 52})
            br
            label "Email (required)"
            input({:name => "email", :id => "email", :type => 'text_field', :size => 52})
            br
            label "Type (required) "
            tag! :select, :name => "report_type", :id => "report_type" do
              tag! :option, "bug"
              tag! :option, "feature request"
              tag! :option, "other"
            end
            br
            p do
              "Please see the <a href=\"http://orgmode.org/org.html#Feedback\">Feedback</a> "+
                "section of the org-mode manual for information on </br> how to submit a useful bug report. "+
                "Don't forget to mention..."
            end
            ol do
              li {"What exactly did you do? "}
              li {"What did you expect to happen? "}
              li {"What happened instead? "}
            end
            label "Description (required)"
            br
            textarea({:name => 'desc', :id => 'desc', :cols => 80, :rows => 16})
            br
            input(:type => "submit", :value => "Submit")
          end
        end
      end
    end
  end
  def thanks
    html do
      head do
        title "Thanks for the Report!"
        style "label {font-weight: bold;}"
      end
      body do
        h1 "Report Submitted"
        p {"Thanks <i>#{@input.name}</i> your report <i>#{@input.title}</i> "+
          "has been submitted, and will be reviewed."}
      end
    end
  end
end

## Controllers
module OrgBugs::Controllers
  class Index < R '/'
    def get; render :index end
  end
  class Submit < R '/submit'
    def post
      report_to_org(@input)
      render :thanks
    end
  end
end

def write_prop(prop, value) "  :#{prop}: #{value}\n" end

def report_to_org(input)
  File.open(ORG_FILE, "a") do |f|
    f << "** SUBMITTED #{input.title}\n"
    f << "  :PROPERTIES:\n"
    f << write_prop(:submitter, input.name)
    f << write_prop(:submitter_email, input.email)
    f << write_prop(:date, DateTime.now.strftime("<%Y-%m-%d -%w- %H:%M>").
                    sub(/-\d-/, DAYS_OF_THE_WEEK[Integer($1)]))
    f << write_prop(:type, input.report_type)
    f << write_prop(:assigned_to, "no-one")
    f << "  :END:\n"
    f << "\n"
    f << input.desc.split(/[\n\r]/).map{|line| ": #{line.chomp}\n" if line.size > 0}.compact.join("")
    f << "\n"
  end
end

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2008-10-24 20:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 16:03 Regression testing for org-mode Robert Goldman
2008-10-23 23:57 ` Eric Schulte
2008-10-24  0:03   ` Avdi Grimm
2008-10-24  2:41     ` Robert Goldman
2008-10-24  3:04       ` worg for bug reports and feature requests was: (Regression testing for org-mode) Eric Schulte
2008-10-24  4:42         ` Robert Goldman
2008-10-24 14:12           ` Sebastian Rose
2008-10-24 14:27             ` Avdi Grimm
2008-10-24 20:44             ` Eric Schulte [this message]
2008-10-24 23:54               ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ljwd4tao.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebastian_rose@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).