changeset 642: |
f58f3b88c49e |
parent: |
6c0e4a44c082
|
child: |
af486e0a40c9 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Sun, 08 Sep 2024 21:14:30 -0400 |
permissions: |
-rw-r--r-- |
description: |
move project-info to scrum |
1 ;;; scrum.el --- Scrum-like Planning and Roadmaps in Org -*- lexical-binding: t; -*- 3 ;; Copyright (C) 2024 Richard Westhaver 5 ;; Author: Richard Westhaver <richard.westhaver@gmail.com> 8 ;; This program is free software; you can redistribute it and/or modify 9 ;; it under the terms of the GNU General Public License as published by 10 ;; the Free Software Foundation, either version 3 of the License, or 11 ;; (at your option) any later version. 13 ;; This program is distributed in the hope that it will be useful, 14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ;; GNU General Public License for more details. 18 ;; You should have received a copy of the GNU General Public License 19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>. 23 ;; The point of this package is to enable an Emacs-native scrum 24 ;; workflow. Many years ago I used to use the org-jira package and 25 ;; mirror an external scrum/agile system (Jira). 27 ;; Mind you, I wouldn't dare take a shot at Jira. As far as Products 28 ;; go, when you need to work with hundreds of humans on software and 29 ;; are given a short list you must choose from, it's often the best of 32 ;; The problem is however, that we don't need Products. What we need, 33 ;; is a plan. How we achieve that end should be via the best and most 34 ;; powerful tools possible. 36 ;; In my opinion, Emacs Org Mode is the most powerful tool 37 ;; available. It is not quite the best tool for the job, but this 38 ;; isn't a problem because it is not a Product. We are given the 39 ;; opportunity to make it the best tool possible, in the only way 40 ;; possible - by doing it ourselves. 42 ;; And yes, the aura of NIH syndrome may be strong here. Most of the 43 ;; time you need to work with lots of folks who don't have the need or 44 ;; patience to learn Org-mode. This package isn't for them. It's for 45 ;; small groups of like-minded Lispers :). 47 ;; ref: https://www.scrum.org/resources/what-scrum-module 49 ;; roadmap: https://compiler.company/plan/roadmap.html 51 ;; tasks: https://compiler.company/plan/tasks 58 "CC Scrum Framework.") 60 (defvar scrum-properties '("SPRINT" "EPIC" "RELEASE" "TASKID" "PROJECT" "COMMIT" "GOAL")) 62 (defvar scrum-tags '("demo" "mvp" "release" "major-release" "ua" "qa")) 64 (defun org-dblock-write:scrumboard () 65 "Generate a 'scrumboard'.") 67 ;; TODO 2024-09-06: eplot 68 (defun org-dblock-write:burndown () 69 "Generate a 'burndown' chart in the current buffer.") 72 ;; defining 'project' machinery here because we don't have a better 73 ;; place to put it. These functions are intended to map projects 74 ;; from 'skel' and 'project.el' into our task-based org system. 76 ;; Projects can contain many subprojects, which are identified by org 77 ;; headings with a 'PROJECT' todo keyword. Projects and sub-projects 78 ;; all have a 'VERSION' property assigned which can't be 79 ;; inherited. The 'PROJECT' property itself can be inherited. 82 (defcustom org-project-info-order '(details status tasks churn log files) 83 "Order in which sections of the 'project-info' dblock will appear." 87 (defun org-dblock-write:project-info (params) 88 "Generate a project-info section. 90 The following keyword parameters can be passed to the info dynamic block: 92 :location Set or override the project location which is inferred by 93 checking for a LOCATION property in the current tree, followed 94 by the value of the `project-current' function. 96 :branch Set or override the project branch to display info for. Default 97 branch name is 'default'. 99 :files When nil don't include the files table. 100 :churn When nil don't include the vc churn report. 101 :log when nil don't include the vc log. 102 :status when nil don't include vc status. 103 :details When nil don't include the project details section." 104 (let ((location (or (when-let ((param (plist-get params :location))) 105 (cl-coerce param 'string)) 106 (org-entry-get (point) "LOCATION") 107 (when-let ((kw (org-collect-keywords '("LOCATION")))) 109 (project-root (project-current)))) 111 (files (if-let ((val (plist-member params :files))) 114 (churn (if-let ((val (plist-member params :churn))) 117 (status (if-let ((val (plist-member params :log))) 120 (log (if-let ((val (plist-member params :status))) 123 (tasks (if-let ((val (plist-member params :tasks))) 126 (details (if-let ((val (plist-member params :details))) 129 (message "Generating info for project: %s" location) 130 (let* ((project (project-current nil location)) 131 (project-name (project-name project)) 132 (project-root (project-root project))) 133 (dolist (i org-project-info-order) 135 ('details (when details 136 (message "building project details...") 137 (insert "#+CALL: project-details() :dir " project-root "\n") 138 (org-babel-execute-maybe) 140 ('status (when status 141 (message "building project status...") 142 (insert "#+CALL: hg-status() :dir " project-root "\n"))) 144 (message "building project tasks...") 145 (insert "#+CALL: project-tasks() :dir " project-root "\n"))) 147 (message "building project vc churn...") 148 (insert "#+CALL: hg-churn() :dir " project-root "\n"))) 150 (message "building project vc log..."))) 152 (message "building project file table...") 153 (insert "#+CALL: project-files() :dir " project-root "\n"))))) 154 (org-babel-execute-region point (point))))) 156 (defun org-project-info () 157 "Insert or update a project-info dblock." 159 (if (re-search-forward (rx bol "#+BEGIN:" (+ space) "project-info") nil t) 161 (if (fboundp 'org-fold-show-entry) 162 (org-fold-show-entry) 163 (with-no-warnings (org-show-entry))) 165 (org-create-dblock (list :name "project-info"))) 169 ;;; scrum.el ends here