Skip to content

abstract rest_api module into a seperate library #97

@2bndy5

Description

@2bndy5

I've been pondering ways to reuse the rest_api module in other projects that want to post feedback in a CI workflow.

Abstracting the module into a standalone library would require trait implementations) allocated on the heap with polymorphic pointer (scoped to a wrapping struct) to keep cpp-linter algorithms separate from REST API usage. This mainly includes

  • creating thread comments' content
  • appending step summary content
  • the comment marker prefixed to each comment (<!-- cpp linter action -->)
  • creating file annotations (which could also be logged errors/warnings/notice/debug messages without specifying file info)
  • creating PR reviews (and auto reuse or dismiss outdated reviews)
  • get list of changed files for an event (and allow for fallback to git CLI for non-CI contexts)

Additional ideas

Create bindings for the abstracted library for use in python and/or node.js. Using rust async runtimes (like tokio) in python is not yet officially supported in pyo3 project (see pyo3 docs).

Update

This abstracted library shouldn't be specific to cpp-linter, so I have created the 2bndy5/git-bot-feedback library on my own GitHub account.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions