Skip to content

Conversation

@individual-it
Copy link
Member

@individual-it individual-it commented Feb 4, 2026

with this PR we adding some extra checks to make sure that the data transferred to OpenProject is correct.
There are 3 checks that are done:

  1. Is the project of the WP active?
  2. Is the project of the WP one of my favorite projects?
  3. Is the WP assigned to me? To make sure a team assignment is also taken into account set openproject.team in ~/.OpenProjectTmetricIntegration.yaml (only one team is currently supported)

The checks are run

  1. when running check tmetric
  • if any of the checks fail, the script will ask for confirmation e.g. ? ⚠️ Found WP 'my WP' in the project 'some project'. This WP is not assigned to you but to 'Artur Neumann'! Do you really want to use a WP that is not assigned to you?? [y/N]
  • if the user chooses y the time is assigned to this WP
  • if the user chooses n a new WP ID can be entered
  1. when running diff
    the diff-table has a new WARNINGS column, listing all possible issues of the WP in OP
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+
| DATE       | TMETRIC ENTRY                      | TM    | OPENPROJECT ENTRY                    | OP    | TIME | WARNINGS               |
|            |                                    | DUR   |                                      | DUR   | DIFF |                        |
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+
| 2026-02-01 |                                    |       |                                      |       | 0    |                        |
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+
| 2026-02-02 |                                    |       |                                      |       | 0    |                        |
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+
| 2026-02-03 | Description: an OP test            | 00:47 | Comment: an OP test                  | 00:47 | 0    | - not favorite project |
|            | - Project: my project              |       | - Project: My Project in OpenProject |       |      | - not my assignment    |
|            | - WP ID: #68405                    |       | - WP ID: #68405                      |       |      |                        |
|            | - WP: Smoketest on Stage completed |       | - WP: Smoketest on Stage completed   |       |      |                        |
|            | - Work Type: Testing               |       | - Activity: Testing                  |       |      |                        |
|            |                                    |       |                                      |       |      |                        |
|            |                                    |       |                                      |       |      |                        |
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+
| 2026-02-04 | Description: a small test          | 01:00 | Comment: a small test                | 01:00 | 0    | - not my assignment    |
|            | - Project: cloud-storage connector |       | - Project: JankariTech (EXT)         |       |      |                        |
|            | - WP ID: #58633                    |       | - WP ID: #58633                      |       |      |                        |
|            | - WP: JankariTech -                |       | - WP: JankariTech -                  |       |      |                        |
|            | - Work Type: Testing               |       | - Activity: Testing                  |       |      |                        |
|            |                                    |       |                                      |       |      |                        |
|            | Description: an other test         | 01:00 | Comment: an other test               | 01:00 |      | - not favorite project |
|            | - Project: some project            |       | - Project: My Project in OpenProject |       |      | - not my assignment    |
|            | - WP ID: #68401                    |       | - WP ID: #68401                      |       |      |                        |
|            | - WP: Release App X.Y.Z            |       | - WP: Release App X.Y.Z              |       |      |                        |
|            | - Work Type: Testing               |       | - Activity: Testing                  |       |      |                        |
|            |                                    |       |                                      |       |      |                        |
|            |                                    |       |                                      |       |      |                        |
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+
|            |                                    |       | Total Diff                           |       | 0    |                        |
+------------+------------------------------------+-------+--------------------------------------+-------+------+------------------------+

@individual-it
Copy link
Member Author

Please test this carefully!

@saw-jan
Copy link
Member

saw-jan commented Feb 5, 2026

Should I get the last one as well?

Some time-entries do not have any workpackages assigned
cloud-storage connector => test 2026-02-05T09:48:00-2026-02-05T09:49:00. Provide a WP number to be assigned to this time-entry (Enter to skip): 42098
? ⚠️  Found WP ' UI/UX imrovements: The search results won't scroll all the way down while using keyboard' in the project 'Stream Nextcloud app "OpenProject Integration"'. This project is none of your favorite projects! Do you really want to use a WP from a not-favorite project?: y
? ⚠️  Found WP ' UI/UX imrovements: The search results won't scroll all the way down while using keyboard' in the project 'Stream Nextcloud app "OpenProject Integration"'. This WP is not assigned to you but to 'Nabin Ale'! Do you really want to use a WP that is not assigned to you?: y
? WP: 42098. Subject:  UI/UX imrovements: The search results won't scroll all the way down while using keyboard. Update t-metric entry?? [y/N] y

@saw-jan
Copy link
Member

saw-jan commented Feb 5, 2026

long work package name can mess up the table
Screenshot from 2026-02-05 10-05-54

@individual-it
Copy link
Member Author

Should I get the last one as well?

Some time-entries do not have any workpackages assigned
cloud-storage connector => test 2026-02-05T09:48:00-2026-02-05T09:49:00. Provide a WP number to be assigned to this time-entry (Enter to skip): 42098
? ⚠️  Found WP ' UI/UX imrovements: The search results won't scroll all the way down while using keyboard' in the project 'Stream Nextcloud app "OpenProject Integration"'. This project is none of your favorite projects! Do you really want to use a WP from a not-favorite project?: y
? ⚠️  Found WP ' UI/UX imrovements: The search results won't scroll all the way down while using keyboard' in the project 'Stream Nextcloud app "OpenProject Integration"'. This WP is not assigned to you but to 'Nabin Ale'! Do you really want to use a WP that is not assigned to you?: y
? WP: 42098. Subject:  UI/UX imrovements: The search results won't scroll all the way down while using keyboard. Update t-metric entry?? [y/N] y

yes, that is the last confirmation, that was there already before

@individual-it individual-it requested a review from saw-jan February 5, 2026 07:36
@individual-it
Copy link
Member Author

@saw-jan I've adjusted the table size calculation and made the warnings be two-liners. Now the long WP names should be cropped
Also I've added a progress indicator for the generation of the diff table

@saw-jan
Copy link
Member

saw-jan commented Feb 5, 2026

table fits now 👍
Screenshot from 2026-02-05 14-03-17

@nabim777
Copy link
Member

nabim777 commented Feb 5, 2026

LGTM 👍🏻

@individual-it individual-it merged commit 0bfec2a into main Feb 6, 2026
2 checks passed
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.

3 participants