[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/zuul 0003af3679 10/17: Add functions for anonymized scr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/zuul 0003af3679 10/17: Add functions for anonymized screenshots |
Date: |
Tue, 30 Aug 2022 11:58:25 -0400 (EDT) |
branch: externals/zuul
commit 0003af3679c223f087ea6c835a2fec31f643f64b
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add functions for anonymized screenshots
---
notes.org | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/notes.org b/notes.org
index 9a96e4146c..34aa58d165 100644
--- a/notes.org
+++ b/notes.org
@@ -105,3 +105,65 @@ Select and open a build retrieved with
=zuul-get-buildsets=.
(zuul-get-buildsets
:change "300203")))
#+end_src
+
+* Screenshots
+
+** Anonymize
+
+Add functions used to =anonymize= data.
+
+#+begin_src elisp :results none
+ (defun zuul-anonymize-build-name (build)
+ (with-temp-buffer
+ (insert (let-alist (zuul-data build) .job_name))
+ (unpackaged/lorem-ipsum-overlay t)
+ (buffer-string)))
+
+ (defun zuul-anonymize-buffer-with-overlay (&rest args)
+ (unpackaged/lorem-ipsum-overlay)
+ (setq mode-line-format nil))
+
+ (defun zuul-anonymize-buffer (&rest args)
+ (unpackaged/lorem-ipsum-overlay)
+ (setq mode-line-format nil))
+
+ (defun zuul-anonymize-silence-messages (orig-fun &rest args)
+ (let ((inhibit-message t))
+ (apply orig-fun args)))
+
+ (defun zuul-anonymize-task-command (data)
+ (let ((command
+ (pcase-let* ((`(,_hostname . ,data) (plist-get data ':host))
+ (cmd-str (let-alist data .cmd)))
+ (if (stringp cmd-str)
+ cmd-str
+ (mapconcat #'identity cmd-str " ")))))
+ (with-temp-buffer
+ (insert command)
+ (unpackaged/lorem-ipsum-overlay t)
+ (buffer-string))))
+#+end_src
+
+Add =advices= around functions that could be sensitive.
+
+#+begin_src elisp :results none
+ (advice-add 'zuul--data-host-cmd-str :override #'zuul-anonymize-task-command)
+ (advice-add 'url-insert-file-contents :around
#'zuul-anonymize-silence-messages)
+ (advice-add 'compile-goto-error :around #'zuul-anonymize-silence-messages)
+ (advice-add 'compile-goto-error :after #'zuul-anonymize-buffer)
+ (advice-add 'zuul-log-mode :after #'zuul-anonymize-buffer-with-overlay)
+ (advice-add 'zuul--build-name-str :override #'zuul-anonymize-build-name)
+ (toggle-frame-tab-bar)
+#+end_src
+
+Remove advices and settings to restore original behavior.
+
+#+begin_src elisp :results none
+ (advice-remove 'zuul--data-host-cmd-str #'zuul-anonymize-task-command)
+ (advice-remove 'url-insert-file-contents #'zuul-anonymize-silence-messages)
+ (advice-remove 'compile-goto-error #'zuul-anonymize-silence-messages)
+ (advice-remove 'compile-goto-error #'zuul-anonymize-buffer)
+ (advice-remove 'zuul-log-mode #'zuul-anonymize-buffer-with-overlay)
+ (advice-remove 'zuul--build-name-str #'zuul-anonymize-build-name)
+ (toggle-frame-tab-bar)
+#+end_src
- [elpa] branch externals/zuul created (now ad20c55828), ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 1ac0b6635e 06/17: Move zuul--highlight-cmd, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 67165f7805 05/17: Add highlight of command, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 0003af3679 10/17: Add functions for anonymized screenshots,
ELPA Syncer <=
- [elpa] externals/zuul 36fb6e7a13 15/17: Address feedback from package-lint, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul c3e69263ce 14/17: Update command section in README, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul b14fb97cc0 03/17: Replace keybinding for eldoc-mode, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul c15f79d769 07/17: Add previous/next command in build log, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 982b0eac12 09/17: Add faces for prompt and input in zuul build, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 83f68268cc 01/17: Add LICENSE file, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul 58af096228 04/17: Update output to contain cmd as well, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul aecdb85b15 02/17: Add zuul.el, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul ad20c55828 17/17: Update required Emacs version, ELPA Syncer, 2022/08/30
- [elpa] externals/zuul d58e139493 08/17: Update zuul-open-build-log implementation, ELPA Syncer, 2022/08/30