Skip to content

Extended data mapping rules #823

@muety

Description

@muety

This feature is based on what was requested in #691, #820 and #822.

Current situation

Currently, Wakapi allows to remap a field's value to an alternative value using the aliases functionality (e.g. map foo-frontend and foo-backend to foo).

Moreover, labels can be used for grouping projects (e.g. assign label work to projects foo and bar).

Lastly, custom language mapping can be defined to map from file ending to language names (e.g. map files ending with .gql to "language" GraphQL).

New functionality

We might substitute these by a single, advanced custom rules feature, where users can define custom mappings (including wildcard patterns, see #607) from any (exposed) field to any other (exposed) field.

Implementation considerations

It is still to be defined how this feature could be implemented on a technical level. All of the above mechanism won't actually modify the underlying heartbeat objects, but only apply the mapping during summary computation. I prefer this mode of operation, because it's "lossless" and you can change or delete your custom mappings at any time without having lost data.

However, the feature requested in #752 (comment) would probably require to rewrite field values already at the time of ingest. Or, alternatively, mapping rules could be as elaborate as to feature a time period they apply to, e.g. "remap language field for project=foo to java for all heartbeats between d1 and d2". This way, @MeltedButter77 would be able to (a) have custom mappings defined while (b) still being able to "reuse" project names (in other words, have different mappings / target values for the same source field value).

I'll have to think about this a bit more thoroughly and it's definitely going to be quite a big change.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions