kriskbx / gitlab-time-tracker

🦊🕘 A command line interface for GitLab's time tracking feature.
GNU General Public License v2.0
458 stars 82 forks source link

gtt fails if 'merge requests' feature is off #99

Open daniviga opened 5 years ago

daniviga commented 5 years ago

We have some projects on a self-hosted GitLab instance that are mainly used for issue tracking and thus they have the 'merge requests' feature off.

Screenshot from 2019-09-27 11-19-12

In such cases gtt fails with an error:

gtt report sysadmin/infrastructure
🔍  Selected projects: sysadmin/infrastructure
🔍  Resolving "sysadmin/infrastructure"... ✓
📦  Fetching issues... ✓
📦  Fetching merge requests... ✗
Error: could not fetch merge requests.

Everything works fine with the feature enabled.

Would it be possible to just skip the collection of statistics from 'merge requests' when the feature has been disabled instead of making the entire process fail?

We are running gtt 1.7.40 on Linux. Many thanks for your work!

qelphybox commented 5 years ago

@daniviga try

gtt report --query=issues sysadmin/infrastructure

it will skip merge requests

HacKanCuBa commented 4 years ago

the same happens for me. It should just skip or check before attempting to get MRs if they are enabled.

johnjaylward commented 3 years ago

Yes, it would be nice if this could be dynamic since when you are running against a "group" you could have a mix of projects with the features enabled or disabled. Having a "soft fail" if a project is missing issues, or missing merge requests would be optimal