Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
eb777a6
Create CODE_OF_CONDUCT.md
bhermann May 7, 2018
51b89dd
Merge pull request #9 from delphi-hub/add-code-of-conduct-1
bhermann May 7, 2018
930a975
Issue templates
bhermann May 7, 2018
14f0b21
Added contribution guide
bhermann May 24, 2018
e3cd594
Adding elastic search dependency
bhermann May 24, 2018
4cb2246
Added a configuration object
bhermann May 24, 2018
447233b
updated sbt version to 1.1.1 to match the version of the main repository
janniclas May 28, 2018
c567946
Merge branch 'develop' of https://github.com/delphi-hub/delphi-webapi…
janniclas May 28, 2018
25ad362
Merge pull request #10 from delphi-hub/feat/global-sbt
bhermann May 28, 2018
33d6349
Added feature endpoint.
almacken May 28, 2018
ea3bd85
Added retrieve endpoint
almacken May 29, 2018
be1255f
Merge pull request #11 from almacken/feature/getFeatures
bhermann May 29, 2018
5bbd2ab
Merge pull request #12 from almacken/feature/retrieveSource
bhermann May 29, 2018
8d2997e
Added feature endpoint.
almacken May 28, 2018
4af0304
Added retrieve endpoint
almacken May 29, 2018
50de868
Merge branch 'develop' of https://github.com/delphi-hub/delphi-webapi…
almacken Jun 5, 2018
769c2b6
Refactored Retrieve to use Actors
almacken Jun 5, 2018
3f69e79
Added Enqueue route, using a priority mailbox
almacken Jun 6, 2018
39b0374
Added Actor that limits request frequency by IP.
almacken Jun 7, 2018
c6c53dc
Improved actor routing
almacken Jun 12, 2018
b933a80
Improved priority handling
almacken Jun 13, 2018
a65271d
Merge pull request #13 from almacken/feature/enqueue
bhermann Jun 14, 2018
4053613
Adding scalastyle to delphi webapi
Jul 3, 2018
48a6980
Finished license application
bhermann Jul 26, 2018
9af2350
Added code coverage support and support for snyk
bhermann Jul 26, 2018
7236fc7
Updated elasticsearch client in order to avoid vulnerable libraries i…
bhermann Jul 26, 2018
ec879b6
Activated scalastyle plugin
bhermann Jul 26, 2018
a6c4030
Moved scala style config to project folder
Jul 31, 2018
273b85a
Added specification for the parser. Todo: Fix Test 2 that loops indef…
sideresearch Jul 31, 2018
f2c5b38
Fixed typo test case. Todo: Infinite loop still there.
sideresearch Aug 1, 2018
270146a
Rule precedence
bhermann Aug 1, 2018
7ae0ff0
Basic parser finished and tested. Todo: add more tests.
sideresearch Aug 1, 2018
de8b79f
Slimmed down and harmonized
bhermann Aug 3, 2018
1b42816
Reactivated version information... tz tz tz.
bhermann Aug 3, 2018
2d9561c
Implemented retrieve command
bhermann Aug 3, 2018
06f136d
Added more tests to the Delphi QL, fixed the operator priority. Now h…
sideresearch Aug 3, 2018
e194b71
Beautification, better tests
sideresearch Aug 4, 2018
993e4a5
Removing scalastyle from test target
Aug 9, 2018
f1f9aea
Merge remote-tracking branch 'origin/develop' into feature/4/scalastyle
bhermann Aug 11, 2018
9d09559
Merge pull request #18 from delphi-hub/feature/4/scalastyle
bhermann Aug 11, 2018
c6fb25b
Update build.sbt
bhermann Aug 11, 2018
576c988
Rename scalastyle_config.xml to scalastyle-config.xml
bhermann Aug 11, 2018
d876af9
Added README
bhermann Aug 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Affected components (if known)**
Choose those applicable here: crawler, cli, webapi, webapp, management

**Desktop (please complete the following information, if relevant):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information, if relevant):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
Just using "none" is okay here.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
language: scala
scala:
- 2.12.4
- 2.12.4
script:
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sbt ++$TRAVIS_SCALA_VERSION test; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt ++$TRAVIS_SCALA_VERSION coverage test coverageReport coverageAggregate codacyCoverage; fi'
after_success:
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash <(curl -s https://codecov.io/bash); fi'
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contribution Guide

We follow the GitHub [Fork & Pull][forkandpull] and [Git Flow][gitflow] workflow in this project.
Please fork the official repository, develop in a branch based on the
current develop branch, and submit a pull request (PR) after you are done.

[forkandpull]: https://help.github.com/articles/about-pull-requests/
[gitflow]: http://nvie.com/posts/a-successful-git-branching-model/

## Checklist before submitting a Pull Request

Before you submit your PR, please go through this list and check if
your request fulfills these points.

- Do you have more changes/additions/deletions in your PR than you expected?
- Do you have tests for your changes?
- Do all tests of the project succeed?
- Is your pull request based on the `develop` branch? [(cf. GitFlow)][gitflow]

If you check these items before, your pull request is more likely to be
included into the project quickly.

13 changes: 1 addition & 12 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,7 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2018 The Delphi Team (represented by Ben Hermann)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Delphi Web API

The web API implementation for the Delphi platform.

We are currently in pre-alpha state! There is no release and the code in
this repository is purely experimental!

|branch | status | codacy |
| :---: | :---: | :---: |
| master | [![Build Status](https://travis-ci.org/delphi-hub/delphi-webapi.svg?branch=master)](https://travis-ci.org/delphi-hub/delphi-webapi) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ebe27850ffb4139af6280fd1cd6d540)](https://www.codacy.com/app/delphi-hub/delphi-webapi?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=delphi-hub/delphi-webapi&amp;utm_campaign=Badge_Grade)|
| develop | [![Build Status](https://travis-ci.org/delphi-hub/delphi-webapi.svg?branch=develop)](https://travis-ci.org/delphi-hub/delphi-webapi) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ebe27850ffb4139af6280fd1cd6d540?branch=develop)](https://www.codacy.com/app/delphi-hub/delphi-webapi?branch=develop&amp;utm_source=github.com&amp;utm_medium=referral&amp;utm_content=delphi-hub/delphi-webapi&amp;utm_campaign=Badge_Grade) |

## What is the Delphi Web API?

It is the primary access point to the Delphi system.

## How does it work?

The Delphi Web API communicates with the underlying Elasticsearch database to provide access to data.

## How can I use it?

If you just wish to query the results, maybe the public instance at https://delphi.cs.uni-paderborn.de is the right choice for you.

If you want to run your own infrastructure, you can start the web API
```
sbt run
```

It expects a running instance of elasticsearch on port 9200 on the same machine.

## Community

Feel welcome to join our chatroom on Gitter: [![Join the chat at https://gitter.im/delphi-hub/delphi](https://badges.gitter.im/delphi-hub/delphi.svg)](https://gitter.im/delphi-hub/delphi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


## Contributing

Contributions are *very* welcome!

Before contributing, please read our [Code of Conduct](CODE_OF_CONDUCT.md).

Refer to the [Contribution Guide](CONTRIBUTING.md) for details about the workflow.
We use Pull Requests to collect contributions. Especially look out for "help wanted" issues
[![GitHub issues by-label](https://img.shields.io/github/issues/delphi-hub/delphi-webapi/help%20wanted.svg)](https://github.com/delphi-hub/delphi-webapi/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22),
but feel free to work on other issues as well.
You can ask for clarification in the issues directly, or use our Gitter
chat for a more interactive experience.

[![GitHub issues](https://img.shields.io/github/issues/delphi-hub/delphi-webapi.svg)](https://github.com/delphi-hub/delphi-webapi/issues)


## License

The Delphi Web API is open source and available under Apache 2 License.

[![GitHub license](https://img.shields.io/github/license/delphi-hub/delphi-webapi.svg)](https://github.com/delphi-hub/delphi-webapi/blob/master/LICENSE)
25 changes: 25 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,33 @@ scalaVersion := "2.12.4"

libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.4"
libraryDependencies += "com.typesafe.akka" %% "akka-http" % "10.0.11"
libraryDependencies += "com.typesafe.akka" %% "akka-stream" % "2.5.12"
libraryDependencies += "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.1"
libraryDependencies += "io.spray" %% "spray-json" % "1.3.3"
libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.4"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % "test"

val elastic4sVersion = "6.3.0"
libraryDependencies ++= Seq(
"com.sksamuel.elastic4s" %% "elastic4s-core" % elastic4sVersion,

// for the http client
"com.sksamuel.elastic4s" %% "elastic4s-http" % elastic4sVersion,

// if you want to use reactive streams
"com.sksamuel.elastic4s" %% "elastic4s-http-streams" % elastic4sVersion,

// testing
"com.sksamuel.elastic4s" %% "elastic4s-testkit" % elastic4sVersion % "test",
"com.sksamuel.elastic4s" %% "elastic4s-embedded" % elastic4sVersion % "test"
)


lazy val webapi = (project in file(".")).
enablePlugins(JavaAppPackaging).
enablePlugins(DockerPlugin).
enablePlugins(ScalastylePlugin).
settings (
dockerBaseImage := "openjdk:jre-alpine"
).
Expand All @@ -19,3 +42,5 @@ lazy val webapi = (project in file(".")).
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "de.upb.cs.swt.delphi.webapi"
)

scalastyleConfig := baseDirectory.value / "project" / "scalastyle-config.xml"
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.17
sbt.version=1.1.1
1 change: 0 additions & 1 deletion project/buildinfo.sbt

This file was deleted.

11 changes: 11 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
// build management and packaging
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.2")

// coverage
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12")

// preparation for dependency checking
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.1")

// scalastyle
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
117 changes: 117 additions & 0 deletions project/scalastyle-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<scalastyle>
<name>Scalastyle standard configuration</name>
<check level="warning" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true">
<parameters>
<parameter name="maxFileLength"><![CDATA[800]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
<parameters>
<parameter name="header"><![CDATA[// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
<parameters>
<parameter name="maxLineLength"><![CDATA[160]]></parameter>
<parameter name="tabSize"><![CDATA[4]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
<parameters>
<parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
<parameters>
<parameter name="maxParameters"><![CDATA[8]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true">
<parameters>
<parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.NullChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.file.RegexChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[println]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true">
<parameters>
<parameter name="maxTypes"><![CDATA[30]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="true">
<parameters>
<parameter name="maximum"><![CDATA[10]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
<parameters>
<parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
<parameter name="doubleLineAllowed"><![CDATA[false]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
<parameters>
<parameter name="maxLength"><![CDATA[50]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
<parameters>
<parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true">
<parameters>
<parameter name="maxMethods"><![CDATA[30]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>
<check level="warning" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
</scalastyle>
Loading