GatorEducator / gatorgradle

:electric_plug: Gradle Plugin to Enable Running GatorGrader as a Gradle Task
https://gatoreducator.github.io/gatorgradle/
GNU General Public License v2.0
7 stars 7 forks source link

WIP: Upload a report to a configured endpoint #53

Closed Michionlion closed 4 years ago

Michionlion commented 5 years ago

This PR, while still in development, has all the core features required for sending an HTTP POST request to a specified endpoint whenever gradle grade is run. This request has a JSON body as seen below. There are some additional considerations for this PR: the biggest one is how to identify each user, since there may not be a central identification paradigm. We could use the configured Git email (which may be machine based), an IP, a machine hostname, etc. All of these have various drawbacks, and I'd like to open this up for discussion. As well as that, is there any more datapoints we should be collecting?

{
  "user": "example@gmail.com",
  "time": "2019-05-31T13:12:45.248750Z",
  "assignment": "gatorgrader-samplelab",
  "report": {
    "numberOfChecks": 4,
    "numberOfFailures": 2,
    "results": [
      {
        "check": "The reflection.md in writing has at least 6 word(s) in every paragraph",
        "outcome": false,
        "diagnostic": "Found 3 word(s) in a paragraph of the specified file"
      }, {
        "check": "The SampleLabMain.java in src/main/java/samplelab has exactly 2 matches of the 'new\\\\s+\\\\S+?\\\\(.*?\\\\)' regular expression",
        "outcome": true,
        "diagnostic": ""
      }, {
        "check": "The SampleLabMain.java in src/main/java/samplelab has at least 2 of the 'println(' fragment",
        "outcome": true,
        "diagnostic": ""
      }, {
        "check": "The SampleLabMain.java in src/main/java/samplelab has at least 3 multiple-line Java comment(s)",
        "outcome": false,
        "diagnostic": "Found 2 comment(s) in the specified file"
      }
    ]
  }
}

This PR is a feature update that fixes #33.

Developers

@Michionlion @enpuyou

gkapfham commented 5 years ago

Hi @Michionlion, is it this PR that will ultimately make it possible to use the version: tag correctly? What do we need to fix for this PR so that this tag will start working and then we can more effectively do local testing with a tagged/branched version of GatorGrader?

Michionlion commented 5 years ago

No, that fix has not been made yet, although this should work for non-branches and new branches; but if a branch is updated, only a fetch is performed, not a pull. That will change in the future when I get a chance to add that!

gkapfham commented 5 years ago

Hi @Michionlion, when you have time, can you please give me a status update on this PR? I plan to start working on the linting interface and the plugin architecture over the weekend and I'm guessing that it would be useful for me to have a fully working version of the version: tag so that I can easily try out my implementation in an existing project. Thanks again for your help with this plugin! Any insights and effort that you can provide would be greatly appreciated!

Michionlion commented 4 years ago

Are we ready for merging here? Does the configuration setup now implemented work for our needs?

Michionlion commented 4 years ago

I would like at least one independent code review of everything one more time before we merge it, @gkapfham @schultzh @corlettim @alexheinle.

Michionlion commented 4 years ago

Codacy Here is an overview of what got changed by this pull request:


Issues
======
+ Solved 33
- Added 10

Complexity increasing per file
==============================
- src/main/java/org/gatorgradle/display/CommandOutputSummary.java  2
- src/main/java/org/gatorgradle/task/GatorGradleGradeTask.java  8
- src/main/java/org/gatorgradle/task/GatorGradleReportTask.java  1

Complexity decreasing per file
==============================
+ src/main/java/org/gatorgradle/task/GatorGradleTask.java  -8

See the complete overview on Codacy

enpuyou commented 4 years ago

Are we ready for merging here? Does the configuration setup now implemented work for our needs?

Yes @Michionlion since we have decided to use plaintext, the code we have now should work. I have also added some documentation/instruction to the README. After merging this PR, I will test it again in Travis CI.