Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Fork syncing Zally 2.0.0 into master and resolving conflicts in docke…
Browse files Browse the repository at this point in the history
…r-compose.yml
  • Loading branch information
u217269 committed Jul 24, 2020
2 parents 90f4f95 + f7f83b0 commit f16ffbc
Show file tree
Hide file tree
Showing 218 changed files with 999 additions and 791 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,29 @@ MIT license with an exception. See [license file](LICENSE).
### Prerequisites

* [Signing plugin](https://docs.gradle.org/current/userguide/signing_plugin.htm) configured
* `OSSRH_JIRA_USERNAME` and `OSSRH_JIRA_PASSWORD` to access [Maven Central Repo](https://oss.sonatype.org/) are
configured in `$HOME/.gradle/gradle.properties`

* `OSSRH_JIRA_USERNAME` and `OSSRH_JIRA_PASSWORD` environment variables to access [Maven Central Repo](https://oss.sonatype.org/) are
configured

### Steps

1. Create a separate branch with a name `release-<release-version>`.
2. Update current version in `server/gradle.properties` from `-SNAPSHOT` to a final version.
3. Release Zally server and API using the command
```
cd server
./gradlew clean build publishAllPublicationsToMavenRepository
```
4. Commit `server/gradle.properties` with the release version
5. Create a tag
```shell script
git tag v<release-version> -m "Version <release-version>"
```
6. Bump version in `server/gradle.properties` to the next `-SNAPSHOT`

7. Push `release` branch and tag
```shell script
git push origin
git push origin <tag-name>
```
8. Create a Pull Request with the version update
9. Create and publish a release with a new version in GitHub
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ services:
- server:server.local
ports:
- "8080:3000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 5s
timeout: 2s
retries: 10

server:
build: ./server
ports:
Expand Down
1 change: 1 addition & 0 deletions server/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ insert_final_newline=true
# possible values: number (e.g. 120) (package name, imports & comments are ignored), "off"
# it's automatically set to 100 on `ktlint --android ...` (per Android Kotlin Style Guide)
max_line_length=off
disabled_rules=import-ordering
67 changes: 48 additions & 19 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand All @@ -11,14 +10,15 @@ plugins {

// We need to declare these here since we are configuring them for
// subprojects from the top level.
`jacoco`
jacoco
`maven-publish`
`signing`
signing
id("com.github.ben-manes.versions") version "0.20.0"
id("org.jetbrains.dokka") version "0.10.0" apply false

// We apply this so that ktlint can format the top level buildscript
id("org.jlleitschuh.gradle.ktlint") version "7.2.1"
id("org.jlleitschuh.gradle.ktlint") version "9.2.1"
id("org.jlleitschuh.gradle.ktlint-idea") version "9.2.1"
}

allprojects {
Expand All @@ -31,13 +31,7 @@ allprojects {

subprojects {

val group = "de.zalando"

val projVersion = when {
System.getenv("JITPACK") == "true" ->
System.getenv("VERSION")
else -> null
} ?: "1.0.0-dev"
group = "org.zalando"

apply(plugin = "kotlin")
apply(plugin = "kotlin-kapt")
Expand Down Expand Up @@ -84,22 +78,57 @@ subprojects {
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = group
artifactId = project.name
version = if (projVersion.endsWith("-dev")) projVersion.replace("-dev", "-SNAPSHOT") else projVersion

from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
description.set("OpenAPI linter service")
url.set("https://github.com/zalando/zally")
name.set("OpenAPI linter")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
name.set("Felix Müller")
email.set("felix.mueller.berlin@googlemail.com")
}
developer {
name.set("Mikhail Chernykh")
email.set("netmisch@gmail.com")
}
developer {
name.set("Maxim Tschumak")
email.set("maxim.tschumak@gmail.com")
}
developer {
name.set("Rui Araujo")
email.set("rui.araujo@zalando.de")
}
developer {
name.set("Tronje Krop")
email.set("tronje.krop@zalando.de")
}
developer {
name.set("Gregor Zeitlinger")
email.set("gregor.zeitlinger@zalando.de")
}
}
scm {
connection.set("scm:git:git://github.com/zalando/zally.git")
developerConnection.set("scm:git:ssh://github.com:zalando/zally.git")
url.set("https://github.com/zalando/zally/tree/master")
}
}
}
}

repositories {
maven {
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
val isSnapshot = projVersion.toString().endsWith("-SNAPSHOT")
url = uri(if (isSnapshot) snapshotsRepoUrl else releasesRepoUrl)
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
// defined in travis project settings or in $HOME/.gradle/gradle.properties
username = System.getenv("OSSRH_JIRA_USERNAME")
Expand Down
1 change: 1 addition & 0 deletions server/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=2.0.1-SNAPSHOT
Binary file modified server/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion server/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion server/gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# 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.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.zalando.zally.core
package org.zalando.zally.core

import de.zalando.zally.rule.api.Rule
import de.zalando.zally.rule.api.RuleSet
import org.zalando.zally.rule.api.Rule
import org.zalando.zally.rule.api.RuleSet
import java.net.URI

abstract class AbstractRuleSet : RuleSet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

interface ApiValidator {
fun validate(content: String, policy: RulesPolicy, authorization: String? = null): List<Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.typesafe.config.Config
import de.zalando.zally.rule.api.Context
import de.zalando.zally.rule.api.Violation
import de.zalando.zally.core.util.PatternUtil
import de.zalando.zally.core.util.getAllHeaders
import de.zalando.zally.core.util.getAllParameters
import de.zalando.zally.core.util.getAllProperties
import de.zalando.zally.core.util.getAllSchemas
import org.zalando.zally.rule.api.Context
import org.zalando.zally.rule.api.Violation
import org.zalando.zally.core.util.PatternUtil
import org.zalando.zally.core.util.getAllHeaders
import org.zalando.zally.core.util.getAllParameters
import org.zalando.zally.core.util.getAllProperties
import org.zalando.zally.core.util.getAllSchemas
import io.github.config4k.extract
import io.swagger.v3.oas.models.media.Schema

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.zalando.zally.core
package org.zalando.zally.core

import de.zalando.zally.rule.api.Check
import de.zalando.zally.rule.api.Rule
import de.zalando.zally.rule.api.RuleSet
import org.zalando.zally.rule.api.Check
import org.zalando.zally.rule.api.Rule
import org.zalando.zally.rule.api.RuleSet
import java.lang.reflect.Method

data class CheckDetails(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

class CompositeRulesValidator(
private val contextRulesValidator: ContextRulesValidator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.zalando.zally.core
package org.zalando.zally.core

import de.zalando.zally.rule.api.Violation
import org.zalando.zally.rule.api.Violation

/**
* Possible results of the `parse` operation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer
import de.zalando.zally.rule.api.Context
import org.zalando.zally.rule.api.Context

/**
* This validator validates a given OpenAPI definition based
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer
import de.zalando.zally.core.ast.ReverseAst
import de.zalando.zally.rule.api.Context
import de.zalando.zally.rule.api.Violation
import org.zalando.zally.core.ast.ReverseAst
import org.zalando.zally.rule.api.Context
import org.zalando.zally.rule.api.Violation
import io.swagger.models.Swagger
import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.Operation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.zalando.zally.core
package org.zalando.zally.core

import de.zalando.zally.rule.api.Context
import de.zalando.zally.rule.api.Violation
import org.zalando.zally.rule.api.Context
import org.zalando.zally.rule.api.Violation
import io.swagger.parser.SwaggerParser
import io.swagger.parser.util.SwaggerDeserializationResult
import io.swagger.v3.parser.OpenAPIV3Parser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer
import org.yaml.snakeyaml.Yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer
import com.fasterxml.jackson.databind.JsonNode
import de.zalando.zally.core.ast.ReverseAst
import org.zalando.zally.core.ast.ReverseAst
import io.swagger.util.Json

class JsonRulesValidator(rules: RulesManager) : RulesValidator<JsonNode>(rules) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer
import com.fasterxml.jackson.databind.JsonNode
Expand All @@ -12,7 +12,7 @@ import com.github.fge.jsonschema.messages.JsonSchemaValidationBundle
import com.github.fge.msgsimple.bundle.MessageBundle
import com.github.fge.msgsimple.load.MessageBundles
import com.github.fge.msgsimple.source.PropertiesMessageSource
import de.zalando.zally.rule.api.Violation
import org.zalando.zally.rule.api.Violation
import java.io.IOException

class JsonSchemaValidator(val schema: JsonNode, schemaRedirects: Map<String, String> = mapOf()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.databind.JsonNode
import io.swagger.parser.util.DeserializationUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.fasterxml.jackson.core.JsonPointer
import de.zalando.zally.rule.api.Severity
import org.zalando.zally.rule.api.Severity
import java.net.URI

data class Result(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.zalando.zally.core
package org.zalando.zally.core

import de.zalando.zally.rule.api.Check
import de.zalando.zally.rule.api.Rule
import de.zalando.zally.rule.api.RuleSet
import org.zalando.zally.rule.api.Check
import org.zalando.zally.rule.api.Rule
import org.zalando.zally.rule.api.RuleSet
import java.lang.reflect.Method

data class RuleDetails(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.google.auto.service.AutoService
import de.zalando.zally.rule.api.Rule
import org.zalando.zally.rule.api.Rule
import javax.annotation.processing.AbstractProcessor
import javax.annotation.processing.Processor
import javax.annotation.processing.RoundEnvironment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package de.zalando.zally.core
package org.zalando.zally.core

import com.typesafe.config.Config
import de.zalando.zally.rule.api.Check
import de.zalando.zally.rule.api.Rule
import de.zalando.zally.rule.api.RuleSet
import org.zalando.zally.rule.api.Check
import org.zalando.zally.rule.api.Rule
import org.zalando.zally.rule.api.RuleSet

class RulesManager(val config: Config, val rules: List<RuleDetails>) {

Expand Down
Loading

0 comments on commit f16ffbc

Please sign in to comment.