Page MenuHomeSoftware Heritage

swh-weekly-report: new helper to write weekly reports
ClosedPublic

Authored by zack on Mar 20 2019, 11:15 PM.

Details

Summary

Helper script to extract personal activity over the past $reporting_period, to
be used as a basis (if, like me, you don't want to trust your memory only...)
for writing activity reports.

Currently supports: tasks, commits, and code reviews.

It is not meant to be completely accurate, not to be used as is, but just as a
*starting point* to check where to look for interesting activities to report.
As such, it is overzealous, and will report activity on elements that you are
subscribed to, even if you're not necessarily the author of said activity.
Might need some tuning, but it would be useful to start using it and iterate
based on actual user feedback.

Test Plan

./swh-weekly-report
./swh-weekly-report --help

Diff Detail

Repository
rDSNIP Code snippets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

  • swh-weekly-report: split generic code to swhphab.py
  • swh-weekly-report: further refactoring/clean-up against swhphab.py
  • swhphab.py: do not crash when printing summary of repo-less diffs
  • swhphab.py: include status when printing task summaries
  • swh-weekly-report: filter on committer date
  • swh-monthly-report: helper script to draft monthly activity team reports
  • swh-monthly-report: filter on committer date

Why is the monthly-report script also in this diff?

swh-team/swhphab.py
24 ↗(On Diff #4072)

why return a list there? I would rather let the user decide whether she wants to use the generator as is or a list... In which case the inner do_query is useless.

35 ↗(On Diff #4072)

well shouldn't this recurse then?

This revision now requires changes to proceed.Mar 28 2019, 9:47 AM
  • swh-weekly-report: preserve iterators and port to current Phabricator
zack added inline comments.
swh-team/swhphab.py
24 ↗(On Diff #4072)

Good point, fixed now.

35 ↗(On Diff #4072)

That'd be a good idea, but unfortunately there is nothing in the API output for conduit method differential.revision.search that allows to obtain the dependency list (short of parsing by hand the diff description, which I'd rather avoid…). Here's a sample output for D1275, which has a dependency on D1274:

{
  "data": [
    {
      "id": 1275,
      "type": "DREV",
      "phid": "PHID-DREV-d46ewswz2shbf4gxfiml",
      "fields": {
        "title": "cloud: add support for compression",
        "authorPHID": "PHID-USER-5w5kl5pfhrsvgq2zwgq4",
        "status": {
          "value": "published",
          "name": "Closed",
          "closed": true,
          "color.ansi": "cyan"
        },
        "repositoryPHID": "PHID-REPO-olzsh75rns73mrq74cgj",
        "diffPHID": "PHID-DIFF-tjq2756zoddynn2jwgde",
        "summary": "And use it in libcloud based backends.\n\nDepends on D1274",
        "testPlan": "",
        "isDraft": false,
        "holdAsDraft": false,
        "dateCreated": 1552995071,
        "dateModified": 1553685989,
        "policy": {
          "view": "public",
          "edit": "users"
        }
      },
      "attachments": {}
    }
  ],
  "maps": {},
  "query": {
    "queryKey": "all"
  },
  "cursor": {
    "limit": 100,
    "after": null,
    "before": null,
    "order": null
  }
}
zack marked an inline comment as done.
This comment was removed by zack.
This comment was removed by zack.
This revision is now accepted and ready to land.Apr 1 2019, 11:55 AM
This revision was automatically updated to reflect the committed changes.