Skip to content

Conversation

@flacombe
Copy link
Contributor

@flacombe flacombe commented Dec 20, 2025

This PR introduces a new concept for Podoma: contributor teams. A team is a list of username defined in each project.
Each team contributions is counted by Podoma in a dedicated thread to be released as several KPI:

  • Length of ways actually contributed
  • Surface of areas actually contributed

Podoma establishes the delta of length and surfaces of each version and each version linked to the team is aggregated to get the global contributed length and areas on each date.

It doesn't currently support the count related to the team, nor labels.

This PR also includes a documentation effort for API and several improvements in processing.

It is necessary to use the following commands to update tables:

CREATE TABLE pdm_projects_teams (
	project_id int,
	team varchar,
	username varchar,
	userid bigint default null
);

alter table pdm_projects_points add column label varchar default null;
alter table pdm_projects_points drop constraint pdm_projects_points_pkey;
alter table pdm_projects_points add constraint pdm_projects_points_unique UNIQUE NULLS NOT DISTINCT (project_id, contrib, label);

alter table pdm_user_contribs add column label varchar default null;
alter table pdm_user_contribs drop column amount;
alter table pdm_user_contribs add column amount_delta int not null default 0;
alter table pdm_user_contribs add column len_delta numeric default 0;
alter table pdm_user_contribs add column area_delta numeric default 0;

Also use the two following commands to rebuild changes materialized views depending on the filter of each projects:
_nodes.sql when the project only involves nodes and _linear.sql when the project has got statistics.length enabled.

psql -v features_table="pdm_features_...slug" -v changes_table="pdm_features_...slug_changes" -f db/22_changes_init_nodes.sql
psql -v features_table="pdm_features_...slug" -v changes_table="pdm_features_...slug_changes" -f db/22_changes_init_linear.sql

Projects points can now mention optional label, to distinguish contribution on different labels:

{
  "statistics": {
    "points": { "add": 2, "edit": 2 },
    "points_labels": {"gendarmerie": {"edit-in": 1}}
  }
}

Teams can be created in info.json of each project with:

{
  "teams": {
    "blue": ["mapper1", "mapper2"],
    "red": ["mapper3", "mapper4"]
  }
}

And we got the corresponding contribution from a team with the URL: /projects/2025-01_project/counts/blue

@flacombe flacombe force-pushed the feature/teams branch 6 times, most recently from 21407b6 to 4f85f19 Compare December 27, 2025 12:19
@flacombe flacombe force-pushed the feature/teams branch 4 times, most recently from 4014753 to 76be122 Compare December 31, 2025 16:07
@flacombe flacombe marked this pull request as ready for review January 4, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant