Page MenuHomeDevCentral

Run query and format as MediaWiki table
ClosedPublic

Authored by dereckson on Sat, Sep 13, 02:06.

Details

Summary

The code is structured with a more modular approach,
so we can create in the future more connectors and output formats.

The first connector allows to query MariaDB/MySQL.
The first output format allows to output a MediaWiki table.

Ref T2124

Test Plan
  • Updated old content report: https://agora.nasqueron.org/?diff=1949
  • Build package, install, try imports
  • echo "Project\tDescription\nnasqueron-reports\tReporting" | sql-result-to-mediawiki-table

Diff Detail

Repository
rRPRT Nasqueron internal reports
Lint
Lint Passed
Unit
No Test Coverage
Branch
reports-tools
Build Status
Buildable 5880
Build 6162: arc lint + arc unit

Event Timeline

dereckson created this revision.

Correctly works fine when invoked from reports repository root, with setenv PYTHONPATH $(pwd)/src.

Missing:

  • packaging
  • correct paths handling in config (see comments)
  • tests for MediaWiki output

Not in scope of this change:

  • MediaWiki client to update the page automatically periodically
  • black magic to run the queries on acquisitariat
src/nasqueron_reports/config.py
24 ↗(On Diff #9496)

Read from /usr/local/etc and /etc too

28 ↗(On Diff #9496)

Unused

33 ↗(On Diff #9496)

What if we deploy reports repository and publish the sql/ folder as /usr/local/share/reports/sql?

Call credentials code from config, not from connector

Organize more as a monorepo, so we've room for other tools too, for example the MediaWiki client

According vermin, our code is compatible with 3.6+ (f-strings)

dereckson retitled this revision from WIP: run query and format as MediaWiki table to Run query and format as MediaWiki table.
dereckson edited the summary of this revision. (Show Details)
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
This revision is now accepted and ready to land.Sat, Sep 13, 12:49
This revision was automatically updated to reflect the committed changes.