Weekly notes for team meetings/reports/emails

Table of Contents

[nil 23922 49921 500797 nil switch-to-buffer (#<buffer *draft*>) nil 957000]

Tasks [0/0] :tasks

QEMU Tooling (VIRT-252)

QEMU plugin support (VIRT-280)

Other Activities

  • Connect travel administrative stuff

Review Queue [0/0] :reviews

Deferred Tasks [0/2]

TODO https://github.com/willnewton/qemucrash

<2017-06-08 Thu 15:31>

Will has a linux-user exec test case which fails.

TODO Fix up ARMv6 memory barriers

QEMU CI Loop (VIRT-187)

  • port existing tests to qa-reports :todo
  • add additional test patterns :todo

MTTCG tests (VIRT-52)

  • need to dust these off and get up-streamed if I'm going to add new tests :todo

Testing and CI

KVM CI Loop (VIRT-2)

  • The LKFT team are working with gregkh to ensure -stable is tested for KVM regressions :done
  • look at example regression to see what would have caught the failure :todo
  • look at kselftest and understand it's place :todo

GSoC Mentoring (VIRT-348)

  • merging work

Absences

  • Connect Sep 23-27th

Actions

These are actions to process my current TODO tasks in various ways

Update JIRA VIRT Tickets

Format headline task in JIRA markup

(defun my-filter-out-todo-lines (s backend info)
  "Filter out lines ending in :todo, - may be mapped to *"
  (apply 'concat
         (--remove (s-matches? (rx ":todo" (zero-or-more blank) eol) it)
                   (s-slice-at (rx bol (in "-*")) s))))

(defun my-filter-headlines (s backend info)
  "Transform Headlines"
  (replace-regexp-in-string
   (rx "{color:" (one-or-more (in alnum "{}")) "{color}")
   "" s))

(defun my-translate-mu4e-links (link backend info)
  "Format mu4e links for export."
  (setq my-debug-var link)
  (let ((type (org-element-property :type link))
        (path (org-element-property :path link))
        (desc (substring-no-properties (nth 2 link))))
    (if (string-match-p "mu4e" type)
        (when (string-match my-org-mu4e-index-links path)
          (format "[%s|https://www.google.com/search?q=%s]"
                  (replace-regexp-in-string
                   (rx (in "({})")) "" desc)
                  (match-string 1 path)))
      (format "[%s|%s]" desc path))))

(org-export-define-derived-backend 'my-jira-export 'jira
  :translate-alist
  '((link . my-translate-mu4e-links))
  :filters-alist
  '((:filter-headline . my-filter-headlines)
    (:filter-plain-list . my-filter-out-todo-lines)))


(if (not my-current-jira-ticket)
    (format "No ticket current set")
  (json-encode-string
   (replace-regexp-in-string
    "\\(?:h[12]\\.\\)" "\nh3."

    (let ((headline-rx (rx bol (one-or-more "*")
                           (one-or-more nonl)
                           (eval (format "virt:%d" my-current-jira-ticket))
                           (not (any digit)))))
      (save-excursion
        ;; Grab the current state of the review queue
        (goto-char (point-min))
        (when (re-search-forward headline-rx)
          (goto-char (match-beginning 0))
          (org-export-as 'my-jira-export t nil t)))))))

Post Comment to JIRA

:auth_basic := (my-pass-password "jira")
:ticket := (format "VIRT-%s" :virt-ticket)

# POST https://dev-projects.linaro.org/rest/api/latest/issue/:ticket/comment
POST https://projects.linaro.org/rest/api/latest/issue/:ticket/comment
Authorization: Basic :auth_basic
Accept: application/json
Content-Type: application/json

{
  "body": :comment
}

Draft Status Email

This section deals with drafting my status emails. A few things a tied together but mainly it is a case of running the exporters over the relevant parts of the document.

Export the current tasks

The main task list used tags (done and todo)

(defun my-filter-out-done-lines (s backend info)
  "Filter out lines ending in :done"
  (apply 'concat
         (--remove (s-matches? (rx ":done" (zero-or-more blank) eol) it)
                   (s-slice-at (rx bol "-") s))))

; headline _back-end _info
(defun my-filter-out-old-completed-todos (s backend info)
  "Filter out DONE items if they where completed over a week ago."
  (let ((date (plist-get info :with-date))
        (todo (plist-get info :with-todo-keywords))
        (todo-type (org-element-property :todo-type s))
        (output s))
    ;; getting there
    (setq my-global-debug-var
          (add-to-list 'my-global-debug-var
                       (list :string s
                             :date date
                             :todo todo
                             :todo-type todo-type)))
    ;; strip ~~~\n lines
    (let ((start (string-match "~+\n" output)))
      (if start
          (concat (substring s 0 start)
                  (substring s (match-end 0)))
        output))))

(org-export-define-derived-backend 'my-status-report 'ascii
  :options-alist
  '((:with-todo-keywords nil)
    (:num nil))
  :filters-alist
  '((:filter-plain-list . my-filter-out-done-lines)
    (:filter-headline . my-filter-out-old-completed-todos)))

;; Snarf the weeks activities
(save-excursion
  (goto-char (point-min))
  (when (re-search-forward "* Tasks")
    (goto-char (match-beginning 0))
    (org-export-as 'my-status-report t nil t )))

Export the current review queue

This is the fragment for dealing with the current review queue. It also relies on a helper in my config to format links when exporting to text files (and html).

(s-join "\n"
  (subseq
   (--remove
     (= 0 (length it))
     (s-lines
      (save-excursion
        ;; Grab the current state of the review queue
        (goto-char (point-min))
        (when (re-search-forward "* Review Queue")
          (goto-char (match-beginning 0))
          (org-export-as 'ascii t nil t)))))
    0 12))

Export current absence plans

(save-excursion
  (goto-char (point-min))
  (when (re-search-forward "* Absences")
    (goto-char (match-beginning 0))
    (org-export-as 'ascii t nil t )))

Draft a new status email

(org-update-statistics-cookies t)

(let ((end-of-week
       (chomp (shell-command-to-string
               "date --date='09:00 this Sun' +'%b. %e %Y'"))))

  (compose-mail
   "linaro-toolchain@lists.linaro.org"
   (format "[ACTIVITY] week ending %s" end-of-week)
   nil
   t
   'switch-to-buffer)
  (insert activities)
  (insert "\n")
  (insert "Absences\n")
  (insert "========\n\n")
  (insert absences)
  (insert "\n")
  (insert "Current Review Queue\n")
  (insert "====================\n\n")
  (insert reviews)
  (run-at-time 1 nil #'switch-to-buffer (current-buffer)))

Default Action

This is the default action bound C-c C-C which attempts to figure out what I want to do when I hammer C-c C-c at any point in the document. As passing parameters around amongst lots of sub-functions is a pain we define my-current-jira-ticket as a global that is referenced by the relevant functions.

(let ((called-point (car org-mark-ring))
      (processed))
  (save-excursion
    (message "Checking at: %s" called-point)
    (goto-char called-point)
    (when (org-at-heading-p)
      (let ((heading (nth 4 (org-heading-components)))
            (virt-rx (rx "[" (or "virt" "tcwg") ":" (group (one-or-more digit)) "]")))
        (when (string-match virt-rx heading)
          (setq my-current-jira-ticket
                (string-to-number (match-string 1 heading)))
          (org-sbe update-ticket)
          (setq processed
                (format "Updated ticket: %s/%d"
                        heading my-current-jira-ticket))))))
  (unless processed
    (message "No default action"))
  processed)

Author: Alex Bennée

Created: 2019-09-11 Wed 17:29

Validate