Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first GitHub entities and automatically fetch them for the leaderboard #62

Merged
merged 57 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8df40a6
(feat): GraphQL + dot Env
GODrums Aug 18, 2024
5ff5a8b
Create GraphQL connection relations
GODrums Aug 18, 2024
8e625b3
fix: add referenced column names
GODrums Aug 18, 2024
bdcca5b
Merge branch 'develop' into feature/github-graphql-artemis
FelixTJDietrich Aug 20, 2024
28c226c
Replace .env with application-local.yml
GODrums Aug 20, 2024
45a6140
fix: transient value error
GODrums Aug 20, 2024
45f228d
Rework for Github API
GODrums Aug 21, 2024
d20d7a5
Merge branch 'develop' into feature/github-graphql-artemis
FelixTJDietrich Aug 23, 2024
37d1d2b
Rework repo fetch
GODrums Aug 24, 2024
78db6d2
Add endpoints for entities
GODrums Aug 25, 2024
fbb09e8
Add entity constructors
GODrums Aug 26, 2024
bae8980
table names to singular
GODrums Aug 28, 2024
d5711f2
replace list with set
GODrums Aug 28, 2024
de9adc4
Add cascade types for actor relations
GODrums Aug 28, 2024
4a372f1
Directly init relation sets
GODrums Aug 28, 2024
85f9e4c
Improve toString printing
GODrums Aug 28, 2024
8a8381b
Replace toString with annotations
GODrums Aug 28, 2024
21d3f7f
Prefer nonnull over nullable column
GODrums Aug 28, 2024
7474b78
Rename Actor, Pullrequest and Comment
GODrums Aug 28, 2024
05ed344
Add user name attribute
GODrums Aug 28, 2024
5b03982
Introduce DTO for user
GODrums Aug 29, 2024
567df15
Replace logger classes
GODrums Aug 29, 2024
1faa0dc
Create GHIssueState enum
GODrums Aug 29, 2024
930a3ef
Deleted unused classes
GODrums Aug 29, 2024
f629070
Remove more unused code
GODrums Aug 29, 2024
6e6b166
Remove github_id from entities
GODrums Aug 29, 2024
7d8df65
Improve entity comments
GODrums Aug 29, 2024
9121e61
Add more DTOs and Superclass
GODrums Aug 30, 2024
322702e
Merge branch 'develop' into feature/github-graphql-artemis
FelixTJDietrich Aug 30, 2024
06528e8
fix indentiation of application.yml
FelixTJDietrich Aug 30, 2024
b58eaea
Merge branch 'develop' into feature/github-graphql-artemis
FelixTJDietrich Aug 30, 2024
bbb2ef7
Implement feedback from review
GODrums Aug 30, 2024
f6b9e7f
Merge branch 'feature/github-graphql-artemis' of https://github.com/l…
GODrums Aug 30, 2024
b93b665
Merge branch 'develop' into feature/github-graphql-artemis
FelixTJDietrich Aug 30, 2024
a9a2410
Improve Entity generation
GODrums Aug 30, 2024
698da27
Merge branch 'feature/github-graphql-artemis' of https://github.com/l…
GODrums Aug 30, 2024
eab0543
Refactor converts with BaseGitServiceEntityConverter
GODrums Aug 30, 2024
cf50f37
Add id to DTOs
GODrums Aug 30, 2024
f9af54a
Add more Repository attributes
GODrums Aug 31, 2024
79a1194
Refactor github sync with cron
GODrums Aug 31, 2024
3588ed7
rename files and pullrequest
FelixTJDietrich Aug 31, 2024
17e6528
Rename scheduler
GODrums Aug 31, 2024
22ead12
Change repositories to fetch
GODrums Aug 31, 2024
e23c516
Redo pullrequest naming
GODrums Sep 1, 2024
3571d40
Make converter services
GODrums Sep 1, 2024
87a2620
Delete EntityNotFoundException
GODrums Sep 1, 2024
5b99ac1
Change to @Component
GODrums Sep 1, 2024
827cb8a
Delete Pullrequest.java
GODrums Sep 2, 2024
8457374
Delete PullrequestRepository.java
GODrums Sep 2, 2024
55e0486
Recommit correct casing files
GODrums Sep 2, 2024
e12ed62
Add default value for ghAuthToken
GODrums Sep 2, 2024
ce402ec
Create a non-environement ghAuthToken
GODrums Sep 2, 2024
21704cf
New OpenAPI specs
GODrums Sep 2, 2024
1530549
Execute generate:api:application-server-client
GODrums Sep 2, 2024
40dfc87
Execute generate:api
GODrums Sep 2, 2024
9b6ca82
Regenerate API from Mac
GODrums Sep 2, 2024
2c822f4
Another openapi regenerate
GODrums Sep 2, 2024
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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.venv
.DS_Store

# Idea files
.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -162,4 +165,6 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

node_modules/
node_modules/

application-local.yml
58 changes: 36 additions & 22 deletions server/application-server/HELP.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
# Getting Started

### Local development

The Spring Boot Maven Plugin supports running your application with a local development environment. To do this, you can use the `spring-boot:run` goal:

```shell
mvn spring-boot:run
```

This will start your application in a local development environment. You can access the application at `http://localhost:8080`.

Setting environment variables works through profile-based `application.yml` files. For local development, create a `application-local.yml` file overwriting the original properties. See [Using the Plugin :: Spring Boot](https://docs.spring.io/spring-boot/maven-plugin/using.html#using.overriding-command-line) for more information.

### Reference Documentation

For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/#build-image)
* [Docker Compose Support](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#features.docker-compose)
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#using.devtools)
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web)
* [Spring Security](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)
* [Spring Boot Actuator](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#actuator)
* [Liquibase Migration](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#howto.data-initialization.migration-tool.liquibase)
* [OAuth2 Client](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.client)
* [OAuth2 Resource Server](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.server)
- [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
- [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/)
- [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/#build-image)
- [Docker Compose Support](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#features.docker-compose)
- [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#using.devtools)
- [Spring Web](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web)
- [Spring Security](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security)
- [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)
- [Spring Boot Actuator](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#actuator)
- [Liquibase Migration](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#howto.data-initialization.migration-tool.liquibase)
- [OAuth2 Client](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.client)
- [OAuth2 Resource Server](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.server)

### Guides

The following guides illustrate how to use some features concretely:

* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
* [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
* [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
* [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
* [Building a RESTful Web Service with Spring Boot Actuator](https://spring.io/guides/gs/actuator-service/)
- [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
- [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
- [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
- [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
- [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
- [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
- [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
- [Building a RESTful Web Service with Spring Boot Actuator](https://spring.io/guides/gs/actuator-service/)

### Docker Compose support

This project contains a Docker Compose file named `compose.yaml`.
In this file, the following services have been defined:

* postgres: [`postgres:latest`](https://hub.docker.com/_/postgres)
- postgres: [`postgres:latest`](https://hub.docker.com/_/postgres)

Please review the tags of the used images and set them to the same as you're running in production.

Expand All @@ -42,4 +57,3 @@ Due to Maven's design, elements are inherited from the parent POM to the project
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.

283 changes: 283 additions & 0 deletions server/application-server/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,64 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Hello"
/user/{login}:
get:
tags:
- user
operationId: getUser
parameters:
- name: login
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/UserDTO"
/pullrequest/{id}:
get:
tags:
- pull-request
operationId: getPullRequest
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/PullRequest"
/pullrequest/author/{login}:
get:
tags:
- pull-request
operationId: getPullRequestsByAuthor
parameters:
- name: login
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequest"
/admin:
get:
tags:
Expand Down Expand Up @@ -69,3 +127,228 @@ components:
Timestamp of when the Hello entity was created.
This field is mandatory.
format: date-time
IssueCommentDTO:
type: object
properties:
id:
type: integer
format: int64
body:
type: string
createdAt:
type: string
updatedAt:
type: string
author:
$ref: "#/components/schemas/UserDTO"
pullRequest:
$ref: "#/components/schemas/PullRequestDTO"
PullRequestDTO:
type: object
properties:
id:
type: integer
format: int64
title:
type: string
url:
type: string
state:
type: string
enum:
- CLOSED
- OPEN
createdAt:
type: string
updatedAt:
type: string
mergedAt:
type: string
author:
$ref: "#/components/schemas/UserDTO"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueCommentDTO"
repository:
$ref: "#/components/schemas/RepositoryDTO"
RepositoryDTO:
type: object
properties:
name:
type: string
nameWithOwner:
type: string
description:
type: string
url:
type: string
UserDTO:
type: object
properties:
id:
type: integer
format: int64
login:
type: string
email:
type: string
name:
type: string
url:
type: string
pullRequests:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequestDTO"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueCommentDTO"
IssueComment:
required:
- body
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
body:
type: string
author:
$ref: "#/components/schemas/User"
pullRequest:
$ref: "#/components/schemas/PullRequest"
PullRequest:
required:
- state
- title
- url
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
title:
type: string
url:
type: string
state:
type: string
description: |-
State of the PullRequest.
Does not include the state of the merge.
enum:
- CLOSED
- OPEN
mergedAt:
type: string
author:
$ref: "#/components/schemas/User"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueComment"
repository:
$ref: "#/components/schemas/Repository"
Repository:
required:
- defaultBranch
- description
- name
- nameWithOwner
- url
- visibility
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
name:
type: string
nameWithOwner:
type: string
description:
type: string
defaultBranch:
type: string
visibility:
type: string
enum:
- PUBLIC
- PRIVATE
url:
type: string
homepage:
type: string
pullRequests:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequest"
User:
required:
- login
- url
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
login:
type: string
description: Unique login identifier for a user.
email:
type: string
name:
type: string
description: Display name of the user.
url:
type: string
description: |-
Unique URL to the user's profile.
Not the website a user can set in their profile.
avatarUrl:
type: string
description: |-
URL to the user's avatar.
If unavailable, a fallback can be generated from the login, e.g. on Github:
https://github.com/{login}.png
pullRequests:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequest"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueComment"
Loading