flags.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _flags:
  2. Flags
  3. =====
  4. Pagure offers the possibility to flag pull-requests and commits. A flag
  5. is a way for a third-party tool to provide feedback on a pull-request or a
  6. commit.
  7. This feedback can be as simple as the outcome of running the tests, or some
  8. lint tool, or test coverage evolution.
  9. Add a flag
  10. ----------
  11. Flags can be set via the API, see the ``/api/`` URL in your pagure instance
  12. or at `pagure.io/api/ <https://pagure.io/api/0/>`_ and look for the endpoints
  13. with the titles: ``Flag a commit`` or ``Flag a pull-request``.
  14. - **uid**: the API endpoints to add flag have an optional UID argument. It
  15. is a unique identifier (of maximum 32 characters) that is unique the commit
  16. or pull-request that is being/has been flagged.
  17. If it is not specified by the user/tool adding the flag, it will be
  18. automatically generated and in either case, will be returned in the JSON
  19. data returned by the API endpoints. Note that this is the only time you
  20. would be able to retrieve this identifier if you do not specify it
  21. yourself.
  22. - **status**: this field indicates the status of the task in the system
  23. running it. Pagure supports the following statuses:
  24. - ``success``: the task ended successfully.
  25. - ``canceled``: the task was canceled.
  26. - ``failure``: the task ended but failed.
  27. - ``error``: the task did not end at all.
  28. - ``pending``: the results of this task are pending.
  29. (for ``failure`` vs ``error`` think of the test system ran the tests but
  30. they failed vs the test system did not get to run the tests)
  31. - **percent**: this is an optional field which can be used to provide some more
  32. details about the outcome of the task. For example this could be used for
  33. test coverage, or the number of test that failed/passed.
  34. - **username**: the name of the system running the tests. While not being
  35. restricted in length, a shorter name will render better in the interface.
  36. - **comment**: a free text form not restricted in length (however, here as
  37. well if the comment is too long it may render off in the interface).
  38. - **url**: the URL the flag is linked to and where the user should be able
  39. to retrieve more information about the task and its outcome.
  40. .. _example_flag_commit:
  41. Example of two flags on a commit:
  42. ---------------------------------
  43. .. image:: _static/pagure_commit_flag.png
  44. :target: ../_images/pagure_commit_flag.png
  45. .. _example_flag_pr:
  46. Example of two flags on a pull-request:
  47. ---------------------------------------
  48. .. image:: _static/pagure_flag_pr.png
  49. :target: ../_images/pagure_flag_pr.png