├── .codecov.yml ├── .editorconfig ├── .gitattributes ├── .github ├── PULL_REQUEST_TEMPLATE.md └── dependabot.yml ├── .gitignore ├── .tekton ├── pnc-cli-pull-request.yaml └── pnc-cli-push.yaml ├── DEVELOPING.md ├── LICENSE ├── README.md ├── auth ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ └── auth │ │ ├── KeycloakClientException.java │ │ ├── KeycloakClientImpl.java │ │ ├── model │ │ ├── CacheFile.java │ │ ├── Credential.java │ │ └── KeycloakResponse.java │ │ └── spi │ │ └── KeycloakClient.java │ └── test │ └── java │ └── org │ └── jboss │ └── pnc │ └── bacon │ └── auth │ └── KeycloakClientImplTest.java ├── bacon_install.py ├── bacon_test.py ├── cli ├── pom.xml └── src │ ├── main │ ├── docker │ │ └── Dockerfile │ ├── java │ │ └── org │ │ │ ├── codehaus │ │ │ └── plexus │ │ │ │ └── logging │ │ │ │ └── console │ │ │ │ └── ConsoleLogger.java │ │ │ └── jboss │ │ │ └── pnc │ │ │ └── bacon │ │ │ └── cli │ │ │ └── App.java │ └── resources │ │ └── logback.xml │ └── test │ └── java │ └── org │ └── jboss │ └── pnc │ └── bacon │ └── cli │ └── AppTest.java ├── common ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ └── common │ │ ├── Constant.java │ │ ├── CustomRestHeaderFilter.java │ │ ├── ObjectHelper.java │ │ ├── TokenAuthenticator.java │ │ ├── Utils.java │ │ ├── cli │ │ ├── AbstractBuildListCommand.java │ │ ├── AbstractGetSpecificCommand.java │ │ ├── AbstractListCommand.java │ │ ├── JSONCommandHandler.java │ │ └── VersionProvider.java │ │ └── exception │ │ └── FatalException.java │ └── test │ └── java │ └── org │ └── jboss │ └── pnc │ └── bacon │ └── common │ └── ObjectHelperTest.java ├── config.yaml ├── config ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jboss │ └── pnc │ └── bacon │ └── config │ ├── AutobuildConfig.java │ ├── Config.java │ ├── ConfigProfile.java │ ├── DaConfig.java │ ├── IndyConfig.java │ ├── KeycloakConfig.java │ ├── PigConfig.java │ ├── PncConfig.java │ ├── RexConfig.java │ └── Validate.java ├── da ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jboss │ │ └── bacon │ │ └── da │ │ ├── DABlockListCli.java │ │ ├── DALookupCli.java │ │ ├── DAReportsCli.java │ │ ├── Da.java │ │ ├── DaHelper.java │ │ └── rest │ │ └── endpoint │ │ ├── ListingsApi.java │ │ ├── LookupApi.java │ │ └── ReportsApi.java │ └── test │ └── java │ └── org │ └── jboss │ └── bacon │ └── da │ └── DaHelperTest.java ├── example-pig-config.yaml ├── experimental ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── bacon │ │ │ └── experimental │ │ │ ├── DependencyGenerator.java │ │ │ ├── Experimental.java │ │ │ ├── cli │ │ │ ├── DependencyGeneratorCommand.java │ │ │ └── ExperimentalCommand.java │ │ │ └── impl │ │ │ ├── config │ │ │ ├── BuildConfigGeneratorConfig.java │ │ │ ├── DefaultBuildConfigValues.java │ │ │ ├── DependencyResolutionConfig.java │ │ │ └── GeneratorConfig.java │ │ │ ├── dependencies │ │ │ ├── DependencyExcluder.java │ │ │ ├── DependencyResolver.java │ │ │ ├── DependencyResult.java │ │ │ ├── GACTVParser.java │ │ │ ├── Project.java │ │ │ └── ProjectDepthComparator.java │ │ │ ├── generator │ │ │ ├── ArgumentTokenizer.java │ │ │ ├── BuildConfigGenerator.java │ │ │ └── ProjectNameGenerator.java │ │ │ └── projectfinder │ │ │ ├── EnvironmentResolver.java │ │ │ ├── FoundProject.java │ │ │ ├── FoundProjects.java │ │ │ └── ProjectFinder.java │ └── resources │ │ └── dependency-generator.yaml │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── bacon │ │ └── experimental │ │ └── impl │ │ ├── dependencies │ │ ├── DependencyExcluderTest.java │ │ ├── DependencyResultTest.java │ │ └── GACTVParserTest.java │ │ ├── generator │ │ ├── BuildConfigGeneratorTest.java │ │ └── ProjectNameGeneratorTest.java │ │ └── projectfinder │ │ └── ProjectFinderTest.java │ └── resources │ ├── config │ ├── config-missing-gavExclusionUrl.yaml │ └── config.yaml │ ├── excluded-empty.txt │ ├── excluded-sample.txt │ └── wiremock │ ├── __files │ ├── body-autobuild-gavexclusion-sample.txt │ ├── body-da-rest-v-1-lookup-maven-versions-built.json │ ├── body-da-rest-v-1-lookup-maven-versions-exactMatch.json │ ├── body-da-rest-v-1-lookup-maven-versions-managed-temp.json │ ├── body-da-rest-v-1-lookup-maven-versions-managed.json │ ├── body-da-rest-v-1-lookup-maven-versions-notbuilt-temp.json │ ├── body-da-rest-v-1-lookup-maven-versions-notbuilt.json │ ├── body-da-rest-v-1-lookup-maven-versions-q2Q4n.json │ ├── body-da-rest-v-1-lookup-maven-versions-temporary-temp.json │ ├── body-da-rest-v-1-lookup-maven-versions-temporary.json │ ├── body-pnc-rest-v2-artifacts-100.json │ ├── body-pnc-rest-v2-artifacts-200.json │ ├── body-pnc-rest-v2-artifacts-300.json │ ├── body-pnc-rest-v2-artifacts-400.json │ ├── body-pnc-rest-v2-artifacts-500.json │ ├── body-pnc-rest-v2-artifacts-built.json │ ├── body-pnc-rest-v2-artifacts-exactMatch.json │ ├── body-pnc-rest-v2-artifacts-temporary.json │ ├── body-pnc-rest-v2-build-configs-100-revisions-100.json │ ├── body-pnc-rest-v2-build-configs-100-revisions.json │ ├── body-pnc-rest-v2-build-configs-100.json │ ├── body-pnc-rest-v2-build-configs-200-revisions-200.json │ ├── body-pnc-rest-v2-build-configs-200-revisions.json │ ├── body-pnc-rest-v2-build-configs-200.json │ ├── body-pnc-rest-v2-build-configs-300-revisions-300.json │ ├── body-pnc-rest-v2-build-configs-300-revisions.json │ ├── body-pnc-rest-v2-build-configs-300.json │ ├── body-pnc-rest-v2-build-configs-400-revisions-400.json │ ├── body-pnc-rest-v2-build-configs-400-revisions.json │ ├── body-pnc-rest-v2-build-configs-400.json │ ├── body-pnc-rest-v2-build-configs-500-revisions-500.json │ ├── body-pnc-rest-v2-build-configs-500-revisions.json │ ├── body-pnc-rest-v2-build-configs-500.json │ ├── body-pnc-rest-v2-build-configs-empty-page.json │ ├── body-pnc-rest-v2-build-configs-exactMatch-revisions-exactMatch.json │ ├── body-pnc-rest-v2-build-configs-exactMatch-revisions.json │ ├── body-pnc-rest-v2-build-configs-exactMatch.json │ ├── body-pnc-rest-v2-build-configs-managed.json │ ├── body-pnc-rest-v2-builds-AAAAA1-artifacts-built.json │ ├── body-pnc-rest-v2-builds-AAAAA2-artifacts-built.json │ ├── body-pnc-rest-v2-builds-AAAAA3-artifacts-built.json │ ├── body-pnc-rest-v2-builds-AAAAA4-artifacts-built.json │ ├── body-pnc-rest-v2-builds-AAAAA5-artifacts-built.json │ ├── body-pnc-rest-v2-builds-AAABUILT01-artifacts-built.json │ ├── body-pnc-rest-v2-builds-AAATEMP01-artifacts-built.json │ ├── body-pnc-rest-v2-builds-exactMatch-artifacts-built.json │ └── body-pnc-rest-v2-generic-setting-announcement-banner-1BYXE.json │ └── mappings │ ├── mapping-autobuild-gavexclusion-sample.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-built.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-exactMatch.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-managed-temp.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-managed.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-notbuilt-temp.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-notbuilt.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-q2Q4n.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-temporary-temp.json │ ├── mapping-da-rest-v-1-lookup-maven-versions-temporary.json │ ├── mapping-pnc-rest-v2-artifacts-100.json │ ├── mapping-pnc-rest-v2-artifacts-200.json │ ├── mapping-pnc-rest-v2-artifacts-300.json │ ├── mapping-pnc-rest-v2-artifacts-400.json │ ├── mapping-pnc-rest-v2-artifacts-500.json │ ├── mapping-pnc-rest-v2-artifacts-built.json │ ├── mapping-pnc-rest-v2-artifacts-exactMatch.json │ ├── mapping-pnc-rest-v2-artifacts-temporary.json │ ├── mapping-pnc-rest-v2-build-configs-100-revisions-100.json │ ├── mapping-pnc-rest-v2-build-configs-100-revisions.json │ ├── mapping-pnc-rest-v2-build-configs-100.json │ ├── mapping-pnc-rest-v2-build-configs-200-revisions-200.json │ ├── mapping-pnc-rest-v2-build-configs-200-revisions.json │ ├── mapping-pnc-rest-v2-build-configs-200.json │ ├── mapping-pnc-rest-v2-build-configs-300-revisions-300.json │ ├── mapping-pnc-rest-v2-build-configs-300-revisions.json │ ├── mapping-pnc-rest-v2-build-configs-300.json │ ├── mapping-pnc-rest-v2-build-configs-400-revisions-400.json │ ├── mapping-pnc-rest-v2-build-configs-400-revisions.json │ ├── mapping-pnc-rest-v2-build-configs-400.json │ ├── mapping-pnc-rest-v2-build-configs-500-revisions-500.json │ ├── mapping-pnc-rest-v2-build-configs-500-revisions.json │ ├── mapping-pnc-rest-v2-build-configs-500.json │ ├── mapping-pnc-rest-v2-build-configs-empty-page.json │ ├── mapping-pnc-rest-v2-build-configs-exactMatch-revisions-exactMatch.json │ ├── mapping-pnc-rest-v2-build-configs-exactMatch-revisions.json │ ├── mapping-pnc-rest-v2-build-configs-exactMatch.json │ ├── mapping-pnc-rest-v2-build-configs-managed.json │ ├── mapping-pnc-rest-v2-builds-AAAAA1-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-AAAAA2-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-AAAAA3-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-AAAAA4-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-AAAAA5-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-AAABUILT01-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-AAATEMP01-artifacts-built.json │ ├── mapping-pnc-rest-v2-builds-exactMatch-artifacts-built.json │ └── mapping-pnc-rest-v2-generic-setting-announcement-banner-1BYXE.json ├── integration-tests ├── pom.xml └── src │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ └── test │ │ ├── AbstractTest.java │ │ ├── CLIExecutor.java │ │ ├── Endpoints.java │ │ ├── ExecutionResult.java │ │ ├── PNCWiremockHelper.java │ │ ├── TestType.java │ │ ├── da │ │ └── DAMavenLatestTest.java │ │ ├── pig │ │ ├── EmptyProjectBuildTest.java │ │ ├── PigFunctionalTest.java │ │ └── PigTest.java │ │ └── pnc │ │ └── ProductTest.java │ └── resources │ ├── config │ ├── build-config.yaml │ └── config.yaml │ ├── empty │ └── build-config.yaml │ └── logback-test.xml ├── licenses-generator ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── pnc │ │ │ └── bacon │ │ │ └── licenses │ │ │ ├── GavFinder.java │ │ │ ├── LicenseSummaryFactory.java │ │ │ ├── LicensesFileManager.java │ │ │ ├── LicensesGenerator.java │ │ │ ├── LicensesGeneratorApplication.java │ │ │ ├── LicensesGeneratorException.java │ │ │ ├── maven │ │ │ ├── MavenEmbedderFactory.java │ │ │ ├── MavenProjectFactory.java │ │ │ ├── MavenProjectFactoryException.java │ │ │ ├── ProjectBuildingRequestFactory.java │ │ │ └── SnowdropMavenEmbedder.java │ │ │ ├── properties │ │ │ ├── GeneratorProperties.java │ │ │ ├── GeneratorPropertiesException.java │ │ │ └── PropertyKeys.java │ │ │ ├── sanitiser │ │ │ ├── AliasLicenseSanitiser.java │ │ │ ├── ExceptionLicenseSanitiser.java │ │ │ ├── LicenseSanitiser.java │ │ │ ├── LicenseServiceSanitiser.java │ │ │ ├── MavenSanitiser.java │ │ │ ├── NoopLicenseSanitiser.java │ │ │ ├── RedHatLicense.java │ │ │ ├── exceptions │ │ │ │ ├── ExactVersionMatcher.java │ │ │ │ ├── LicenseException.java │ │ │ │ ├── RangeVersionMatcher.java │ │ │ │ ├── RegexpVersionMatcher.java │ │ │ │ └── VersionMatcher.java │ │ │ └── provider │ │ │ │ ├── ExternalLicenseDto.java │ │ │ │ ├── ExternalLicenseProvider.java │ │ │ │ └── ExternalLicensesDto.java │ │ │ ├── utils │ │ │ ├── Gav.java │ │ │ └── JsonUtils.java │ │ │ └── xml │ │ │ ├── DependencyElement.java │ │ │ ├── LicenseElement.java │ │ │ ├── LicenseSummary.java │ │ │ └── OfflineLicenseMirror.java │ └── resources │ │ ├── generator.properties │ │ ├── licenses.qute │ │ ├── offline-license-mirror │ │ ├── README.md │ │ ├── ftp.gnu.org │ │ │ └── gnu │ │ │ │ └── non-gnu │ │ │ │ └── chinese-fonts-truetype │ │ │ │ └── LICENSE │ │ ├── repository.jboss.org │ │ │ └── licenses │ │ │ │ ├── JBossORG-EULA.txt │ │ │ │ ├── antlr.txt │ │ │ │ ├── apache-1.1.txt │ │ │ │ ├── apache-2.0-epl-2.0.txt │ │ │ │ ├── apache-2.0.txt │ │ │ │ ├── asm.txt │ │ │ │ ├── bcla-jdk6.txt │ │ │ │ ├── bouncycastle.txt │ │ │ │ ├── bsd.txt │ │ │ │ ├── cc-by-3.0.txt │ │ │ │ ├── cc-by-nc-3.0.txt │ │ │ │ ├── cc-by-nc-nd-3.0.txt │ │ │ │ ├── cc-by-nc-sa-3.0.txt │ │ │ │ ├── cc-by-nd-3.0.txt │ │ │ │ ├── cc-by-sa-3.0.txt │ │ │ │ ├── cc-public-domain-mark-1.0.txt │ │ │ │ ├── cc0-1.0.txt │ │ │ │ ├── cddl-v1.1.txt │ │ │ │ ├── cddl.txt │ │ │ │ ├── cpl-1.0.txt │ │ │ │ ├── day-jcr.txt │ │ │ │ ├── docbook.txt │ │ │ │ ├── dom4j.txt │ │ │ │ ├── easymock.txt │ │ │ │ ├── edl-1.0.txt │ │ │ │ ├── ehcache.txt │ │ │ │ ├── epl-1.0.txt │ │ │ │ ├── exolab.txt │ │ │ │ ├── fdl-1.1.txt │ │ │ │ ├── fdl-1.2.txt │ │ │ │ ├── gpl-1.0.txt │ │ │ │ ├── gpl-2.0-ce.txt │ │ │ │ ├── gpl-2.0.txt │ │ │ │ ├── gpl-3.0.txt │ │ │ │ ├── gpl.txt │ │ │ │ ├── h2.txt │ │ │ │ ├── hsqldb.txt │ │ │ │ ├── httpunit.txt │ │ │ │ ├── ironsmith.txt │ │ │ │ ├── jargs.txt │ │ │ │ ├── javamail-1.4.2.txt │ │ │ │ ├── jaxen.txt │ │ │ │ ├── jbossorg-eula.txt │ │ │ │ ├── jbpm-bpel.txt │ │ │ │ ├── jcip-cc-by-2.5.txt │ │ │ │ ├── jdom-1.0.txt │ │ │ │ ├── jsr-170-ri.txt │ │ │ │ ├── jsr94_ri_license.txt │ │ │ │ ├── jtidy.txt │ │ │ │ ├── juddi.txt │ │ │ │ ├── lgpl-2.0.txt │ │ │ │ ├── lgpl-2.1.txt │ │ │ │ ├── lgpl-3.0.txt │ │ │ │ ├── lgpl.txt │ │ │ │ ├── license-info.xml │ │ │ │ ├── mit.txt │ │ │ │ ├── mozilla-1.0.1.txt │ │ │ │ ├── mpl-1.1.txt │ │ │ │ ├── nekohtml.txt │ │ │ │ ├── opensaml.txt │ │ │ │ ├── osgi-1.0.txt │ │ │ │ ├── oswego.txt │ │ │ │ ├── public-domain.txt │ │ │ │ ├── retrotranslator.txt │ │ │ │ ├── sleepcat.txt │ │ │ │ ├── sleepycat.txt │ │ │ │ ├── slf4j.txt │ │ │ │ ├── srp.txt │ │ │ │ ├── sun-jaas.txt │ │ │ │ ├── sun-jaf.txt │ │ │ │ ├── sun-javamail.txt │ │ │ │ ├── sun-jaxp.txt │ │ │ │ ├── sun-jca.txt │ │ │ │ ├── sun-jce.txt │ │ │ │ ├── sun-jdbc.txt │ │ │ │ ├── sun-jdk142x.txt │ │ │ │ ├── sun-jmf.txt │ │ │ │ ├── sun-jsse.txt │ │ │ │ ├── sun-jta.txt │ │ │ │ ├── sun-specs.txt │ │ │ │ ├── sun-xacml.txt │ │ │ │ ├── trove.txt │ │ │ │ ├── tyrex.txt │ │ │ │ ├── w3c.txt │ │ │ │ ├── xdoclet.txt │ │ │ │ └── xmldb.txt │ │ ├── www.apache.org │ │ │ └── licenses │ │ │ │ ├── LICENSE-1.0 │ │ │ │ ├── LICENSE-1.0.txt │ │ │ │ ├── LICENSE-1.1 │ │ │ │ ├── LICENSE-1.1.txt │ │ │ │ ├── LICENSE-2.0 │ │ │ │ ├── LICENSE-2.0.html │ │ │ │ ├── LICENSE-2.0.txt │ │ │ │ ├── NOTICE-2.0.txt │ │ │ │ ├── cla-corporate.txt │ │ │ │ ├── cla-faq.html │ │ │ │ ├── contributor-agreements.html │ │ │ │ ├── icla.txt │ │ │ │ └── software-grant.txt │ │ └── www.gnu.org │ │ │ ├── licenses │ │ │ ├── 200104_seminar.html │ │ │ ├── 210104_seminar.html │ │ │ ├── NYC_Seminars_Jan2004.html │ │ │ ├── agpl-3.0 │ │ │ ├── agpl-3.0-standalone.html │ │ │ ├── agpl-3.0.html │ │ │ ├── agpl.md │ │ │ ├── agpl.txt │ │ │ ├── autoconf-exception-3.0.html │ │ │ ├── bsd │ │ │ ├── bsd.he.html │ │ │ ├── bsd.html │ │ │ ├── bsd.id.html │ │ │ ├── copyleft │ │ │ ├── copyleft.html │ │ │ ├── copyleft.id.html │ │ │ ├── dsl.html │ │ │ ├── ecos-license.html │ │ │ ├── eiffel-forum-license-2.html │ │ │ ├── exceptions │ │ │ ├── exceptions.html │ │ │ ├── fdl-1.1 │ │ │ ├── fdl-1.2 │ │ │ ├── fdl-1.3 │ │ │ ├── fdl-1.3-faq.html │ │ │ ├── fdl-1.3-standalone.html │ │ │ ├── fdl-1.3.html │ │ │ ├── fdl-1.3.txt │ │ │ ├── fdl-db5.xml │ │ │ ├── fdl-howto │ │ │ ├── fdl-howto-opt │ │ │ ├── fdl-howto-opt.html │ │ │ ├── fdl-howto.html │ │ │ ├── fdl.md │ │ │ ├── fdl.txt │ │ │ ├── fdl.xml │ │ │ ├── gcc-exception-3.0 │ │ │ ├── gcc-exception-3.0.html │ │ │ ├── gcc-exception-3.1 │ │ │ ├── gcc-exception-3.1-faq.html │ │ │ ├── gcc-exception-3.1.html │ │ │ ├── gpl-1.0 │ │ │ ├── gpl-2.0 │ │ │ ├── gpl-3.0 │ │ │ ├── gpl-3.0-standalone.html │ │ │ ├── gpl-3.0.html │ │ │ ├── gpl-3.0.rst │ │ │ ├── gpl-faq │ │ │ ├── gpl-faq.html │ │ │ ├── gpl-howto │ │ │ ├── gpl-howto.html │ │ │ ├── gpl-violation │ │ │ ├── gpl-violation.html │ │ │ ├── gpl.html │ │ │ ├── gpl.md │ │ │ ├── gpl.txt │ │ │ ├── gpl.xml │ │ │ ├── gplv3-the-program.html │ │ │ ├── hessla.html │ │ │ ├── identify-licenses-clearly.html │ │ │ ├── javascript-labels-rationale.html │ │ │ ├── javascript-labels.html │ │ │ ├── lgpl+gpl-3.0.txt │ │ │ ├── lgpl-2.1 │ │ │ ├── lgpl-3.0 │ │ │ ├── lgpl-3.0-standalone.html │ │ │ ├── lgpl-3.0.html │ │ │ ├── lgpl-3.0.txt │ │ │ ├── lgpl-java.html │ │ │ ├── lgpl.dbk │ │ │ ├── lgpl.md │ │ │ ├── lgpl.txt │ │ │ ├── license-compatibility │ │ │ ├── license-compatibility.html │ │ │ ├── license-list │ │ │ ├── license-list.html │ │ │ ├── license-recommendations │ │ │ ├── license-recommendations.html │ │ │ ├── licenses.html │ │ │ ├── licenses.html.en │ │ │ ├── old-licenses │ │ │ │ ├── fdl-1.1 │ │ │ │ ├── fdl-1.1-standalone.html │ │ │ │ ├── fdl-1.1.html │ │ │ │ ├── fdl-1.1.md │ │ │ │ ├── fdl-1.1.txt │ │ │ │ ├── fdl-1.2 │ │ │ │ ├── fdl-1.2-standalone.html │ │ │ │ ├── fdl-1.2.html │ │ │ │ ├── fdl-1.2.md │ │ │ │ ├── fdl-1.2.txt │ │ │ │ ├── fdl-1.2.xml │ │ │ │ ├── gpl-1.0 │ │ │ │ ├── gpl-1.0-standalone.html │ │ │ │ ├── gpl-1.0.html │ │ │ │ ├── gpl-1.0.md │ │ │ │ ├── gpl-1.0.txt │ │ │ │ ├── gpl-2.0 │ │ │ │ ├── gpl-2.0-standalone.html │ │ │ │ ├── gpl-2.0.html │ │ │ │ ├── gpl-2.0.md │ │ │ │ ├── gpl-2.0.txt │ │ │ │ ├── lgpl-2.0 │ │ │ │ ├── lgpl-2.0-standalone.html │ │ │ │ ├── lgpl-2.0.html │ │ │ │ ├── lgpl-2.0.md │ │ │ │ ├── lgpl-2.0.txt │ │ │ │ ├── lgpl-2.1 │ │ │ │ ├── lgpl-2.1-standalone.html │ │ │ │ ├── lgpl-2.1.html │ │ │ │ ├── lgpl-2.1.md │ │ │ │ └── lgpl-2.1.txt │ │ │ ├── quick-guide-gplv3 │ │ │ ├── quick-guide-gplv3.html │ │ │ ├── recommended-copylefts │ │ │ ├── recommended-copylefts.html │ │ │ ├── rms-why-gplv3.html │ │ │ ├── translations │ │ │ ├── translations.html │ │ │ ├── why-affero-gpl │ │ │ ├── why-affero-gpl.html │ │ │ ├── why-assign │ │ │ ├── why-assign.html │ │ │ ├── why-gfdl │ │ │ ├── why-gfdl.html │ │ │ ├── why-not-lgpl │ │ │ ├── why-not-lgpl.html │ │ │ ├── why-not-lgpl.id.html │ │ │ └── why-not-lgpl.ro.html │ │ │ └── prep │ │ │ └── maintain │ │ │ └── html_node │ │ │ └── License-Notices-for-Other-Files.html │ │ ├── rh-license-exceptions.json │ │ ├── rh-license-names.json │ │ └── simplelogger.properties │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ └── licenses │ │ ├── ExternalLicensesTest.java │ │ ├── LicenseServiceMock.java │ │ ├── LicenseSummaryFactoryTest.java │ │ ├── maven │ │ └── MavenProjectFactoryTest.java │ │ ├── properties │ │ └── GeneratorPropertiesTest.java │ │ ├── sanitiser │ │ ├── AliasLicenseSanitiserTest.java │ │ ├── ExceptionLicenseSanitiserTest.java │ │ ├── NoopLicenseSanitiserTest.java │ │ ├── RedHatLicenseTest.java │ │ └── exceptions │ │ │ ├── ExactVersionMatcherTest.java │ │ │ ├── RangeVersionMatcherTest.java │ │ │ └── RegexpVersionMatcherTest.java │ │ └── xml │ │ ├── LicenseSummaryTest.java │ │ └── OfflineLicenseMirrorTest.java │ └── resources │ ├── rh-license-exceptions.json │ ├── rh-license-names.json │ ├── test-pom-with-exceptions.xml │ ├── test-pom.xml │ └── test_properties │ ├── empty.properties │ ├── modified.properties │ └── wrong-repositories.properties ├── pig ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── pnc │ │ │ └── bacon │ │ │ └── pig │ │ │ ├── Cachi2Lockfile.java │ │ │ ├── Pig.java │ │ │ ├── PigExport.java │ │ │ ├── PigFacade.java │ │ │ └── impl │ │ │ ├── MisconfigurationException.java │ │ │ ├── PigContext.java │ │ │ ├── addons │ │ │ ├── AddOn.java │ │ │ ├── AddOnFactory.java │ │ │ ├── ExtraDeliverableDownloader.java │ │ │ ├── cachi2 │ │ │ │ ├── Cachi2Lockfile.java │ │ │ │ ├── Cachi2LockfileAddon.java │ │ │ │ ├── Cachi2LockfileGenerator.java │ │ │ │ └── YamlUtil.java │ │ │ ├── camel │ │ │ │ ├── CamelRuntimeDependenciesToAlignTree.java │ │ │ │ ├── RuntimeDependenciesToAlignTree.java │ │ │ │ ├── TreeNode.java │ │ │ │ └── TreeParser.java │ │ │ ├── microprofile │ │ │ │ ├── BuildLogWithDependencyTrees.java │ │ │ │ └── MicroProfileSmallRyeCommunityDepAnalyzer.java │ │ │ ├── quarkus │ │ │ │ ├── ByExtensionCollectingVisitor.java │ │ │ │ ├── QuarkusCommunityDepAnalyzer.java │ │ │ │ ├── QuarkusCommunityDependency.java │ │ │ │ ├── QuarkusExtension.java │ │ │ │ ├── QuarkusExtensions.java │ │ │ │ ├── QuarkusPostBuildAnalyzer.java │ │ │ │ └── VertxArtifactFinder.java │ │ │ ├── rhba │ │ │ │ └── OfflineManifestGenerator.java │ │ │ ├── runtime │ │ │ │ ├── CommunityDepAnalyzer.java │ │ │ │ ├── RuntimeDependenciesAnalyzer.java │ │ │ │ └── ThorntailDepAnalyzer.java │ │ │ ├── scanservice │ │ │ │ ├── PostBuildScanService.java │ │ │ │ ├── ScanServiceDTO.java │ │ │ │ └── pssaas │ │ │ │ │ ├── AddAuthHeadersRequestFilter.java │ │ │ │ │ ├── RedirectAndLog.java │ │ │ │ │ ├── ScanHelper.java │ │ │ │ │ └── ScanInterface.java │ │ │ ├── spring │ │ │ │ └── BomVerifierAddon.java │ │ │ └── vertx │ │ │ │ ├── FindTransitiveDuplicateArtifactsInDepTree.java │ │ │ │ ├── NotYetAlignedFromDependencyTree.java │ │ │ │ └── SaveBuildLogsLocally.java │ │ │ ├── common │ │ │ └── DeliverableManager.java │ │ │ ├── config │ │ │ ├── AdditionalArtifactsFromBuild.java │ │ │ ├── BuildConfig.java │ │ │ ├── FieldGroup.java │ │ │ ├── Flow.java │ │ │ ├── GenerationData.java │ │ │ ├── GroupBuildInfo.java │ │ │ ├── JavadocGenerationData.java │ │ │ ├── JavadocGenerationStrategy.java │ │ │ ├── LicenseGenerationData.java │ │ │ ├── LicenseGenerationStrategy.java │ │ │ ├── Output.java │ │ │ ├── PigConfiguration.java │ │ │ ├── ProductConfig.java │ │ │ ├── RepoGenerationData.java │ │ │ └── RepoGenerationStrategy.java │ │ │ ├── documents │ │ │ ├── DataRoot.java │ │ │ ├── Deliverables.java │ │ │ ├── DocumentGenerator.java │ │ │ ├── FileGenerator.java │ │ │ ├── Template.java │ │ │ └── sharedcontent │ │ │ │ ├── BrewSearcher.java │ │ │ │ ├── DASearcher.java │ │ │ │ ├── MRRCSearcher.java │ │ │ │ ├── SharedContentReportGenerator.java │ │ │ │ ├── SharedContentReportRow.java │ │ │ │ └── da │ │ │ │ ├── CommunityDependency.java │ │ │ │ ├── CsvExportable.java │ │ │ │ ├── DADao.java │ │ │ │ ├── DAListArtifact.java │ │ │ │ ├── DependencyState.java │ │ │ │ └── ThorntailCommunityDependency.java │ │ │ ├── javadoc │ │ │ └── JavadocManager.java │ │ │ ├── license │ │ │ ├── LicenseGenerator.java │ │ │ └── LicenseManager.java │ │ │ ├── mapping │ │ │ └── BuildConfigMapping.java │ │ │ ├── nvr │ │ │ └── NvrListGenerator.java │ │ │ ├── out │ │ │ ├── PigBuildOutput.java │ │ │ ├── PigReleaseOutput.java │ │ │ └── PigRunOutput.java │ │ │ ├── pnc │ │ │ ├── ArtifactWrapper.java │ │ │ ├── BuildConfigData.java │ │ │ ├── BuildInfoCollector.java │ │ │ ├── GitRepoInspector.java │ │ │ ├── ImportResult.java │ │ │ ├── NoSuccessfulBuildException.java │ │ │ ├── PncBuild.java │ │ │ ├── PncBuilder.java │ │ │ ├── PncConfigurator.java │ │ │ └── PncEntitiesImporter.java │ │ │ ├── repo │ │ │ ├── ArtifactProgressTracker.java │ │ │ ├── ArtifactVersion.java │ │ │ ├── BomRepoGenerationSummary.java │ │ │ ├── ExternalArtifactDownloader.java │ │ │ ├── ParentPomDownloader.java │ │ │ ├── RepoBuilder.java │ │ │ ├── RepoDescriptor.java │ │ │ ├── RepoManager.java │ │ │ ├── RepositoryData.java │ │ │ ├── RepositoryUtils.java │ │ │ ├── ResolvedArtifactCollector.java │ │ │ ├── ResolvedGav.java │ │ │ ├── Sl4jMessageWriter.java │ │ │ └── visitor │ │ │ │ ├── ArtifactVisit.java │ │ │ │ ├── ArtifactVisitor.java │ │ │ │ ├── FileSystemArtifactRepository.java │ │ │ │ ├── FileSystemArtifactVisit.java │ │ │ │ └── VisitableArtifactRepository.java │ │ │ ├── script │ │ │ └── ScriptGenerator.java │ │ │ ├── sources │ │ │ ├── SourcesGenerationData.java │ │ │ ├── SourcesGenerationStrategy.java │ │ │ └── SourcesGenerator.java │ │ │ ├── utils │ │ │ ├── AlignmentType.java │ │ │ ├── BuildFinderUtils.java │ │ │ ├── CSVUtils.java │ │ │ ├── CollectionUtils.java │ │ │ ├── FileDownloadUtils.java │ │ │ ├── FileUtils.java │ │ │ ├── GAV.java │ │ │ ├── GavPattern.java │ │ │ ├── GavSet.java │ │ │ ├── GerritUtils.java │ │ │ ├── HashUtils.java │ │ │ ├── MavenRepositoryUtils.java │ │ │ ├── MilestoneNumberFinder.java │ │ │ ├── OSCommandException.java │ │ │ ├── OSCommandExecutor.java │ │ │ ├── PncClientUtils.java │ │ │ ├── PropertyUtils.java │ │ │ ├── ResourceUtils.java │ │ │ ├── SleepUtils.java │ │ │ ├── XmlUtils.java │ │ │ ├── indy │ │ │ │ └── Indy.java │ │ │ └── pom │ │ │ │ ├── Dependency.java │ │ │ │ ├── DependencyManagement.java │ │ │ │ ├── Profile.java │ │ │ │ ├── Profiles.java │ │ │ │ └── Project.java │ │ │ └── validation │ │ │ ├── GenerationDataCheck.java │ │ │ ├── GenerationDataValidator.java │ │ │ ├── ListBuildConfigCheck.java │ │ │ └── ListBuildConfigValidator.java │ └── resources │ │ ├── ARTIFACT_LIST.ftl │ │ ├── BUILD_LIST.ftl │ │ ├── DUPLICATE_ARTIFACT_LIST.ftl │ │ ├── README.ftl │ │ ├── REPOSITORY_CONTENTS.ftl │ │ ├── REPOSITORY_COORDINATES.ftl │ │ ├── indy-settings.xml │ │ ├── indy-temp-settings.xml │ │ ├── koji-build-finder │ │ └── config.json │ │ ├── license-generator.properties │ │ ├── pom-template.xml │ │ ├── repository-README.md │ │ ├── repository-example-settings.xml │ │ ├── rh-license-exceptions.json │ │ ├── rh-license-names.json │ │ ├── settings-template.xml │ │ └── uploadToCandidates.sh │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ ├── config │ │ └── ConfigReaderTest.java │ │ ├── pig │ │ └── impl │ │ │ ├── PigContextTest.java │ │ │ ├── addons │ │ │ ├── camel │ │ │ │ ├── TreeNodeTest.java │ │ │ │ └── TreeParserTest.java │ │ │ ├── quarkus │ │ │ │ ├── QuarkusCommunityDepAnalyzerTest.java │ │ │ │ └── QuarkusPostBuildAnalyzerTest.java │ │ │ ├── rhba │ │ │ │ └── OfflineManifestGeneratorTest.java │ │ │ ├── scanservice │ │ │ │ ├── MockScanServiceTest.java │ │ │ │ ├── ScanServiceDTOTest.java │ │ │ │ └── ValidationTest.java │ │ │ └── vertx │ │ │ │ └── NotYetAlignedFromDependencyTreeTest.java │ │ │ ├── config │ │ │ ├── PigConfigurationTest.java │ │ │ └── RepoGenerationDataTest.java │ │ │ ├── documents │ │ │ └── sharedcontent │ │ │ │ └── da │ │ │ │ └── DADaoTest.java │ │ │ ├── mapping │ │ │ └── BuildConfigMappingTest.java │ │ │ ├── nvr │ │ │ └── NvrListGeneratorTest.java │ │ │ ├── pnc │ │ │ └── PncBuilderTest.java │ │ │ ├── repo │ │ │ ├── BomMultiStepRepositoryStrategyTest.java │ │ │ ├── MultiStepBomBasedRepositoryTestBase.java │ │ │ ├── RepositoryUtilsTest.java │ │ │ ├── ResolveOnlyRepositoryTest.java │ │ │ ├── ResolveOnlyStepsRepositoryTest.java │ │ │ └── TestPlatformBuilder.java │ │ │ ├── utils │ │ │ ├── BuildFinderUtilsTest.java │ │ │ ├── GAVTest.java │ │ │ ├── GavPatternTest.java │ │ │ ├── GavSetTest.java │ │ │ ├── HashUtilsTest.java │ │ │ └── indy │ │ │ │ └── IndyTest.java │ │ │ └── validation │ │ │ ├── BuildConfigTest.java │ │ │ ├── GenerationDataCheckTest.java │ │ │ ├── ListBuildConfigCheckTest.java │ │ │ └── PigConfigurationValidationTest.java │ │ └── resources │ │ └── ResourcesValidationTest.java │ └── resources │ ├── MultiStepBomBasedRepositoryTestBase │ └── resolve-and-repackage-repo-artifact-list.txt │ ├── __files │ ├── build-stub.html │ ├── community-deps1.csv │ ├── community-deps2.csv │ ├── expectedPostBuildInfo.txt │ ├── new-prod-deliverable-stub.html │ ├── nonexistent-redhat-deps1.txt │ ├── nonexistent-redhat-deps2.txt │ ├── old-prod-deliverable-stub.html │ ├── quarkus-1.0.0-licenses.zip │ ├── quarkus-1.0.1-licenses.zip │ ├── repository-artifact-list1.txt │ └── repository-artifact-list2.txt │ ├── build-config-UnknownVar.yaml │ ├── build-config-VarUsage.yaml │ ├── build-config-custom-repo-generation.yaml │ ├── build-config-environment-override.yaml │ ├── build-config.yaml │ ├── builds.json │ ├── camel-build-log-2.txt │ ├── camel-build-log.txt │ ├── config.yaml │ ├── hash │ ├── additional-file │ │ ├── file1.txt │ │ ├── file2.txt │ │ └── file3.txt │ ├── additional-newline │ │ ├── file1.txt │ │ └── file2.txt │ ├── copy-with-file-to-be-ignored │ │ ├── file1.txt │ │ ├── file2.txt │ │ └── ignore-me │ ├── copy │ │ ├── file1.txt │ │ └── file2.txt │ ├── moved-file │ │ ├── file1.txt │ │ └── subdir │ │ │ └── file2.txt │ ├── original │ │ ├── file1.txt │ │ └── file2.txt │ ├── removed-file │ │ └── file1.txt │ └── renamed-file │ │ ├── file1.txt │ │ └── file1342.txt │ ├── logback-test.xml │ └── resolve-and-repackage-repo-artifact-list.txt ├── pnc ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ └── pnc │ │ ├── AdminCli.java │ │ ├── ArtifactCli.java │ │ ├── BrewPushCli.java │ │ ├── BuildCli.java │ │ ├── BuildConfigCli.java │ │ ├── DeliverableAnalysisCli.java │ │ ├── EnvironmentCli.java │ │ ├── GroupBuildCli.java │ │ ├── GroupConfigCli.java │ │ ├── Pnc.java │ │ ├── ProductCli.java │ │ ├── ProductMilestoneCli.java │ │ ├── ProductReleaseCli.java │ │ ├── ProductVersionCli.java │ │ ├── ProjectCli.java │ │ ├── ScmRepositoryCli.java │ │ ├── WhoAmICli.java │ │ ├── admin │ │ ├── AnnouncementBannerCli.java │ │ ├── MaintenanceModeCli.java │ │ └── RexCli.java │ │ ├── client │ │ ├── BifrostClient.java │ │ └── PncClientHelper.java │ │ └── common │ │ ├── ClientCreator.java │ │ ├── ParameterChecker.java │ │ └── UrlGenerator.java │ └── test │ ├── java │ └── org │ │ └── jboss │ │ └── pnc │ │ └── bacon │ │ └── pnc │ │ ├── ArtifactCliTest.java │ │ ├── ProductReleaseCliTest.java │ │ ├── ProductVersionCliTest.java │ │ └── common │ │ ├── ParameterCheckerTest.java │ │ └── UrlGeneratorTest.java │ └── resources │ └── config.yaml ├── pom.xml ├── static-resources ├── CC0-1.0.txt ├── CDDL+GPL-1.1 ├── CDDL-1.1.txt ├── EPL-1.0.txt ├── EPL-2.0.txt ├── UPL-1.0.txt ├── deprecated_LGPL-2.1+.txt └── mysql-license.txt ├── test-common ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jboss │ └── pnc │ └── bacon │ └── testcommon │ └── RemoteTest.java └── test └── build-config.yaml /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 1% 6 | patch: off 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | max_line_length = 120 10 | tab_width = 4 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * -text 2 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Checklist: 2 | 3 | * [ ] Have you added a note in the [CHANGELOG wiki](https://github.com/project-ncl/bacon/wiki/Changelog) for your change if user-facing? 4 | * [ ] Have you added unit tests for your change? 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "maven" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | target 4 | __pycache__ 5 | 6 | # vscode crap 7 | **/.classpath 8 | **/.factorypath 9 | **/.project 10 | **/.settings 11 | **/.DS_Store 12 | .vscode 13 | 14 | .cache 15 | 16 | cli/dependency-reduced-pom.xml 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Introduction 3 | 4 | Bacon is a new Java CLI for [ProjectNCL](https://github.com/project-ncl/pnc) 2.0 combining features of old PNC, DA CLI and PiG tooling. 5 | 6 | # Documentation 7 | 8 | User documentation is available [here](https://project-ncl.github.io/bacon). This includes guidance on the `build-config.yaml` files and the features available. 9 | 10 | Contributions are welcome! Please see the [Developer's guide](https://github.com/project-ncl/bacon/blob/master/DEVELOPING.md) to get up and running with developing in Bacon. 11 | 12 | Finally, our [changelog](https://project-ncl.github.io/bacon/changelog.html) lists the changes that happened in releases. 13 | 14 | --- 15 | # Reporting an issue 16 | To report an issue, please use the NCLSUP/NCL projects in the internal JIRA instance. The Github issues usage is now disabled. 17 | -------------------------------------------------------------------------------- /auth/src/main/java/org/jboss/pnc/bacon/auth/KeycloakClientException.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.auth; 2 | 3 | public class KeycloakClientException extends Exception { 4 | public KeycloakClientException(Throwable e) { 5 | super(e); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /auth/src/main/java/org/jboss/pnc/bacon/auth/model/KeycloakResponse.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.auth.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | import lombok.Data; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | public class KeycloakResponse { 11 | 12 | @JsonProperty("access_token") 13 | private String accessToken; 14 | 15 | @JsonProperty("refresh_token") 16 | private String refreshToken; 17 | 18 | /** Unit in second */ 19 | @JsonProperty("expires_in") 20 | private int expiresIn; 21 | 22 | /** Unit in second */ 23 | @JsonProperty("refresh_expires_in") 24 | private int refreshExpiresIn; 25 | } 26 | -------------------------------------------------------------------------------- /auth/src/test/java/org/jboss/pnc/bacon/auth/KeycloakClientImplTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.auth; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import org.jboss.pnc.bacon.auth.spi.KeycloakClient; 6 | import org.jboss.pnc.bacon.common.exception.FatalException; 7 | import org.junit.jupiter.api.Test; 8 | 9 | class KeycloakClientImplTest { 10 | 11 | @Test 12 | void testGetServiceAccountFatalExceptionThrownOnTLSCertException() { 13 | KeycloakClient keycloakClient = new KeycloakClientImpl(); 14 | try { 15 | keycloakClient.getCredentialServiceAccount( 16 | "https://self-signed.badssl.com", 17 | "true-love", 18 | "bassackwards", 19 | "only-me"); 20 | } catch (Exception e) { 21 | assertSame(FatalException.class, e.getCause().getClass()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cli/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/openjdk-17 AS builder 2 | 3 | USER 0 4 | 5 | WORKDIR /work/ 6 | COPY ./ . 7 | 8 | RUN mvn -V -B package -DskipTests 9 | 10 | FROM registry.access.redhat.com/ubi8/openjdk-17-runtime 11 | ENV TZ UTC 12 | ENV LANG en_US.UTF-8 13 | 14 | USER 0 15 | RUN microdnf install -y gettext wget jq && \ 16 | LATEST_YQ_VERSION=$(wget -qO- https://api.github.com/repos/mikefarah/yq/releases/latest | jq -r '.tag_name') && \ 17 | wget https://github.com/mikefarah/yq/releases/download/${LATEST_YQ_VERSION}/yq_linux_amd64 -O /usr/local/bin/yq && \ 18 | chmod +x /usr/local/bin/yq && \ 19 | microdnf clean all 20 | 21 | COPY --from=builder /work/cli/target/bacon.jar /home/jboss/ 22 | 23 | USER 185 24 | 25 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/Constant.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.common; 2 | 3 | import java.io.File; 4 | 5 | public class Constant { 6 | 7 | public static final String DEFAULT_CONFIG_FOLDER = System.getProperty("user.home") + File.separator + ".config" 8 | + File.separator + "pnc-bacon"; 9 | 10 | public static final String CONFIG_FILE_NAME = "config.yaml"; 11 | 12 | public static final String CONFIG_ENV = "PNC_CONFIG_PATH"; 13 | 14 | public static final String PIG_CONTEXT_DIR = "PIG_CONTEXT_DIR"; 15 | 16 | public static final String CACHE_FILE = "saved-user.json"; 17 | 18 | public static final String EXAMPLE_TEXT = "%n@|bold Example:|@%n"; 19 | 20 | public static final String JSON_OUTPUT = "-o"; 21 | 22 | public static final String HISTORY = System.getProperty("user.home") + File.separator + ".pnc-bacon-history.txt"; 23 | 24 | private Constant() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/CustomRestHeaderFilter.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.common; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.ws.rs.client.ClientRequestContext; 6 | import javax.ws.rs.client.ClientRequestFilter; 7 | 8 | import org.jboss.pnc.api.constants.MDCHeaderKeys; 9 | import org.jboss.pnc.common.otel.OtelUtils; 10 | 11 | import io.opentelemetry.api.trace.SpanContext; 12 | 13 | public class CustomRestHeaderFilter implements ClientRequestFilter { 14 | 15 | private final SpanContext spanContext; 16 | 17 | public CustomRestHeaderFilter(SpanContext spanContext) { 18 | this.spanContext = spanContext; 19 | } 20 | 21 | @Override 22 | public void filter(ClientRequestContext requestContext) throws IOException { 23 | requestContext.getHeaders().add(MDCHeaderKeys.TRACE_ID.getHeaderName(), spanContext.getTraceId()); 24 | requestContext.getHeaders().add(MDCHeaderKeys.SPAN_ID.getHeaderName(), spanContext.getSpanId()); 25 | OtelUtils.createTraceStateHeader(spanContext).forEach((k, v) -> requestContext.getHeaders().add(k, v)); 26 | OtelUtils.createTraceParentHeader(spanContext).forEach((k, v) -> requestContext.getHeaders().add(k, v)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/TokenAuthenticator.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.common; 2 | 3 | import java.io.IOException; 4 | import java.util.function.Supplier; 5 | 6 | import javax.ws.rs.client.ClientRequestContext; 7 | import javax.ws.rs.client.ClientRequestFilter; 8 | import javax.ws.rs.core.MultivaluedMap; 9 | 10 | public class TokenAuthenticator implements ClientRequestFilter { 11 | 12 | private final Supplier tokenSupplier; 13 | 14 | public TokenAuthenticator(Supplier tokenSupplier) { 15 | this.tokenSupplier = tokenSupplier; 16 | } 17 | 18 | public void filter(ClientRequestContext requestContext) throws IOException { 19 | MultivaluedMap headers = requestContext.getHeaders(); 20 | headers.add("Authorization", "Bearer " + this.tokenSupplier.get()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.common; 19 | 20 | /** 21 | * Utils class shared among all apps 22 | */ 23 | public class Utils { 24 | 25 | /** 26 | * Handle picky case where sourceUrl may end with "/" in the config file, and combine it gracefully with the path 27 | * 28 | * @param sourceUrl source url 29 | * @param path remaining part of url 30 | * @return beautifully assembled url 31 | */ 32 | public static String generateUrlPath(String sourceUrl, String path) { 33 | 34 | if (sourceUrl.endsWith("/")) { 35 | return sourceUrl.substring(0, sourceUrl.length() - 2) + path; 36 | } else { 37 | return sourceUrl + path; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/cli/JSONCommandHandler.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.common.cli; 2 | 3 | import org.jboss.pnc.bacon.common.Constant; 4 | import org.jboss.pnc.bacon.common.exception.FatalException; 5 | 6 | import lombok.extern.slf4j.Slf4j; 7 | import picocli.CommandLine; 8 | import picocli.CommandLine.Model.CommandSpec; 9 | import picocli.CommandLine.Spec; 10 | 11 | @Slf4j 12 | public class JSONCommandHandler { 13 | @Spec 14 | public CommandSpec commandSpec; 15 | 16 | /** 17 | * Retrieve the value of the json output option. 18 | * 19 | * @return a boolean if json output is enabled. 20 | */ 21 | protected boolean getJsonOutput() { 22 | CommandLine.Model.OptionSpec option = commandSpec.root().findOption(Constant.JSON_OUTPUT); 23 | if (option == null) { 24 | throw new FatalException("Unable to locate JSON parameter in root"); 25 | } 26 | Boolean value = option. getValue(); 27 | log.debug("JSON command is enabled: {}", value); 28 | return value; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/cli/VersionProvider.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.common.cli; 2 | 3 | import org.commonjava.maven.ext.common.util.ManifestUtils; 4 | 5 | import picocli.CommandLine; 6 | 7 | public class VersionProvider implements CommandLine.IVersionProvider { 8 | /** 9 | * Returns version information for a command. 10 | * 11 | * @return version information (each string in the array is displayed on a separate line) 12 | * @throws Exception an exception detailing what went wrong when obtaining version information 13 | */ 14 | @Override 15 | public String[] getVersion() throws Exception { 16 | return new String[] { "Bacon version " + ManifestUtils.getManifestInformation(VersionProvider.class) }; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/jboss/pnc/bacon/common/exception/FatalException.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.common.exception; 2 | 3 | import org.commonjava.maven.ext.common.ExceptionHelper; 4 | import org.slf4j.helpers.MessageFormatter; 5 | 6 | /** 7 | * Throw this exception instead of using System.exit(1) 8 | */ 9 | public class FatalException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | private Object[] params; 14 | 15 | private String formattedMessage; 16 | 17 | public FatalException(final String message, final Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public FatalException(final String string, final Object... params) { 22 | super(string, ExceptionHelper.getThrowableCandidate(params)); 23 | this.params = params; 24 | } 25 | 26 | @Override 27 | public synchronized String getMessage() { 28 | if (formattedMessage == null) { 29 | formattedMessage = MessageFormatter.arrayFormat(super.getMessage(), params).getMessage(); 30 | } 31 | return formattedMessage; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.jboss.pnc.bacon 6 | parent 7 | 3.0.3-SNAPSHOT 8 | 9 | 10 | config 11 | 12 | 13 | 14 | 15 | org.projectlombok 16 | lombok 17 | 18 | 19 | 20 | 21 | org.slf4j 22 | slf4j-api 23 | 24 | 25 | 26 | com.fasterxml.jackson.core 27 | jackson-core 28 | 29 | 30 | com.fasterxml.jackson.core 31 | jackson-databind 32 | 33 | 34 | com.fasterxml.jackson.dataformat 35 | jackson-dataformat-yaml 36 | 37 | 38 | 39 | javax.validation 40 | validation-api 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/AutobuildConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.config; 19 | 20 | import lombok.Data; 21 | 22 | @Data 23 | public class AutobuildConfig implements Validate { 24 | private String gavExclusionUrl; 25 | 26 | @Override 27 | public void validate() { 28 | Validate.validateUrl(gavExclusionUrl, "GAV Exclusion file"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/ConfigProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.config; 19 | 20 | import java.util.Map; 21 | 22 | import lombok.Data; 23 | 24 | @Data 25 | public class ConfigProfile { 26 | 27 | private String name; 28 | private String keycloakUrl; 29 | private PncConfig pnc; 30 | private DaConfig da; 31 | private IndyConfig indy; 32 | private PigConfig pig; 33 | private KeycloakConfig keycloak; 34 | private AutobuildConfig autobuild; 35 | private RexConfig rex; 36 | private boolean enableExperimental; 37 | 38 | private Map> addOns; 39 | } 40 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/DaConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.config; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
24 | * Date: 12/17/18 25 | */ 26 | @Data 27 | public class DaConfig implements Validate { 28 | private String url; 29 | 30 | @Override 31 | public void validate() { 32 | Validate.validateUrl(url, "Dependency Analysis URL"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/IndyConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.config; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
24 | * Date: 12/17/18 25 | */ 26 | @Data 27 | public class IndyConfig implements Validate { 28 | private String url; 29 | 30 | @Override 31 | public void validate() { 32 | Validate.validateUrl(url, "Indy URL"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/PigConfig.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.config; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com 2020-06-05 7 | */ 8 | @Data 9 | public class PigConfig implements Validate { 10 | 11 | private String kojiHubUrl; 12 | private String licenseServiceUrl; 13 | private String indyUrl; 14 | 15 | @Override 16 | public void validate() { 17 | Validate.validateUrl(kojiHubUrl, "KojiHub URL"); 18 | Validate.validateUrl(licenseServiceUrl, "License Service URL"); 19 | Validate.validateUrl(indyUrl, "Indy URL"); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/PncConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.config; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
24 | * Date: 12/17/18 25 | */ 26 | @Data 27 | public class PncConfig implements Validate { 28 | 29 | private String url; 30 | 31 | private String bifrostBaseurl; 32 | 33 | @Override 34 | public void validate() { 35 | Validate.validateUrl(url, "PNC"); 36 | Validate.validateUrl(bifrostBaseurl, "Bifrost"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /config/src/main/java/org/jboss/pnc/bacon/config/RexConfig.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.config; 2 | 3 | import lombok.Data; 4 | import lombok.extern.slf4j.Slf4j; 5 | 6 | @Data 7 | @Slf4j 8 | public class RexConfig implements Validate { 9 | 10 | // Url of Rex server 11 | private String url; 12 | 13 | @Override 14 | public void validate() { 15 | Validate.validateUrl(url, "Rex"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /da/src/main/java/org/jboss/bacon/da/Da.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.bacon.da; 19 | 20 | import picocli.CommandLine.Command; 21 | 22 | /** 23 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
24 | * Date: 12/13/18 25 | */ 26 | @Command( 27 | name = "da", 28 | description = "Dependency Analysis related commands", 29 | subcommands = { DABlockListCli.class, DALookupCli.class, DAReportsCli.class }) 30 | public class Da { 31 | } 32 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/Experimental.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.bacon.experimental; 19 | 20 | import picocli.CommandLine.Command; 21 | 22 | @Command( 23 | name = "experimental", 24 | hidden = true, 25 | description = "EXPERIMENTAL COMMANDS: commands that are not fully supported, in development and/or without backward compatibility guarantee.", 26 | subcommands = { DependencyGenerator.class }) 27 | public class Experimental { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/cli/ExperimentalCommand.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.cli; 2 | 3 | import java.util.concurrent.Callable; 4 | 5 | import org.jboss.pnc.bacon.common.cli.JSONCommandHandler; 6 | import org.jboss.pnc.bacon.common.exception.FatalException; 7 | import org.jboss.pnc.bacon.config.Config; 8 | import org.jboss.pnc.bacon.config.ConfigProfile; 9 | 10 | public abstract class ExperimentalCommand extends JSONCommandHandler implements Callable { 11 | 12 | @Override 13 | public Integer call() { 14 | ConfigProfile activeProfile = Config.instance().getActiveProfile(); 15 | if (!activeProfile.isEnableExperimental()) { 16 | throw new FatalException("Running Experimental is not enabled. See documentation how to enable it."); 17 | } 18 | return runCommand(); 19 | } 20 | 21 | public void run() { 22 | } 23 | 24 | public int runCommand() { 25 | run(); 26 | return 0; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/config/DefaultBuildConfigValues.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.config; 2 | 3 | import javax.validation.constraints.NotEmpty; 4 | import javax.validation.constraints.NotNull; 5 | 6 | import org.jboss.pnc.dto.validation.constraints.SCMUrl; 7 | 8 | import com.fasterxml.jackson.annotation.JsonInclude; 9 | 10 | import lombok.Data; 11 | 12 | /** 13 | * Default values to be used when generating build config. 14 | */ 15 | @Data 16 | @JsonInclude(JsonInclude.Include.NON_EMPTY) 17 | public class DefaultBuildConfigValues { 18 | /** 19 | * Name of the environment to be used when generating new build config. Required. 20 | */ 21 | @NotNull 22 | private String environmentName; 23 | 24 | /** 25 | * Build script to be used when generating new build config. 26 | */ 27 | @NotEmpty 28 | private String buildScript = "mvn deploy"; 29 | 30 | /** 31 | * Placeholder SCM URL. 32 | * 33 | * To be used when no SCM url was found for the project. We need it to generate valid build-config. 34 | */ 35 | @SCMUrl(message = "must be valid git url") 36 | private String scmUrl = "https://github.com/michalszynkiewicz/empty.git"; 37 | 38 | /** 39 | * Placeholder SCM revision to be used when using placeholder URL or when SCM revision was not resolved. 40 | */ 41 | @NotEmpty 42 | private String scmRevision = "master"; 43 | } 44 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/config/GeneratorConfig.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.config; 2 | 3 | import javax.validation.Valid; 4 | import javax.validation.constraints.NotNull; 5 | 6 | import com.fasterxml.jackson.annotation.JsonInclude; 7 | 8 | import lombok.Data; 9 | 10 | @Data 11 | @JsonInclude(JsonInclude.Include.NON_EMPTY) 12 | public class GeneratorConfig { 13 | @Valid 14 | @NotNull 15 | private DependencyResolutionConfig dependencyResolutionConfig = new DependencyResolutionConfig(); 16 | @Valid 17 | @NotNull 18 | private BuildConfigGeneratorConfig buildConfigGeneratorConfig = new BuildConfigGeneratorConfig(); 19 | } 20 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/dependencies/DependencyResult.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.dependencies; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | import lombok.Data; 7 | 8 | @Data 9 | public class DependencyResult { 10 | private Set topLevelProjects; 11 | 12 | public int getCount() { 13 | HashSet allProjects = new HashSet<>(); 14 | topLevelProjects.forEach(p -> fillAllProject(allProjects, p)); 15 | return allProjects.size(); 16 | } 17 | 18 | private void fillAllProject(Set allProjects, Project project) { 19 | if (!allProjects.contains(project)) { 20 | allProjects.add(project); 21 | project.getDependencies().forEach(p -> fillAllProject(allProjects, p)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/dependencies/Project.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.dependencies; 2 | 3 | import java.util.Set; 4 | 5 | import org.jboss.da.model.rest.GAV; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | 10 | @Data 11 | @EqualsAndHashCode(exclude = { "dependencies", "depth", "cutDependency", "name", "conflictingName" }) 12 | public class Project { 13 | private String sourceCodeURL; 14 | private String sourceCodeRevision; 15 | private Set gavs; 16 | 17 | private String name; 18 | 19 | private Set dependencies; 20 | private int depth = -1; 21 | private boolean cutDependency = false; 22 | private boolean conflictingName = false; 23 | 24 | public GAV getFirstGAV() { 25 | return gavs.stream().sorted().findFirst().get(); 26 | } 27 | 28 | public String getName() { 29 | if (name == null) { 30 | throw new IllegalStateException( 31 | "You must run project generator on the projects, to generate names for them first."); 32 | } 33 | return name; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "Project{" + "sourceCodeURL='" + sourceCodeURL + '\'' + ", sourceCodeRevision='" + sourceCodeRevision 39 | + '\'' + ", gavs=" + gavs + ", name='" + name + '\'' + '}'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/dependencies/ProjectDepthComparator.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.dependencies; 2 | 3 | import java.util.Comparator; 4 | 5 | public class ProjectDepthComparator implements Comparator { 6 | @Override 7 | public int compare(Project p1, Project p2) { 8 | int r = p1.getDepth() - p2.getDepth(); 9 | if (r == 0) { 10 | r = p1.getFirstGAV().compareTo(p2.getFirstGAV()); 11 | } 12 | return r; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/projectfinder/FoundProject.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.projectfinder; 2 | 3 | import java.util.Set; 4 | 5 | import org.jboss.da.model.rest.GAV; 6 | import org.jboss.pnc.dto.BuildConfiguration; 7 | import org.jboss.pnc.dto.BuildConfigurationRevision; 8 | 9 | import lombok.Data; 10 | 11 | @Data 12 | public class FoundProject { 13 | private Set gavs; 14 | private BuildConfigurationRevision buildConfigRevision; 15 | private BuildConfiguration buildConfig; 16 | /** 17 | * Did we find existing Build Config? 18 | */ 19 | private boolean found; 20 | /** 21 | * Is the found build config created by previous runs of autobuilder? 22 | */ 23 | private boolean managed; 24 | /** 25 | * Did the found build produced exact match of the version? Exact match means the same Major.Minor.Micro.Qualifier, 26 | * but can differ in the -redhat suffix. 27 | */ 28 | private boolean exactMatch; 29 | /** 30 | * Did the found build produced all the GAs? 31 | */ 32 | private boolean complete; 33 | /** 34 | * Is the Build Config Revision the latest revision for that Build Config? 35 | */ 36 | private boolean latestRevision; 37 | } 38 | -------------------------------------------------------------------------------- /experimental/src/main/java/org/jboss/bacon/experimental/impl/projectfinder/FoundProjects.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.projectfinder; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | import lombok.Data; 7 | 8 | @Data 9 | public class FoundProjects { 10 | private Set foundProjects = new HashSet<>(); 11 | } 12 | -------------------------------------------------------------------------------- /experimental/src/main/resources/dependency-generator.yaml: -------------------------------------------------------------------------------- 1 | dependencyResolutionConfig: 2 | excludeArtifacts: 3 | - org.apache.maven:*:* 4 | 5 | buildConfigGeneratorConfig: 6 | defaultValues: 7 | environmentName: "OpenJDK 11.0; Mvn 3.5.4" 8 | scmReplaceWithPlaceholder: 9 | - "svn.apache.org" 10 | scmPattern: 11 | "git@github.com:": "https://github.com/" 12 | scmMapping: 13 | "example.com/repo/foo.git": "https://example.com/gerrit/repo/foo.git" 14 | 15 | pigTemplate: 16 | product: 17 | name: Autobuild Example 18 | abbreviation: ABX 19 | stage: Alpha 20 | issueTrackerUrl: https://issues.example.com/projects/ABX 21 | version: 0.0.1 22 | milestone: DR1 23 | group: autobuild-example 24 | builds: 25 | - 26 | flow: 27 | licensesGeneration: 28 | strategy: IGNORE 29 | repositoryGeneration: 30 | strategy: IGNORE 31 | javadocGeneration: 32 | strategy: IGNORE 33 | sourcesGeneration: 34 | strategy: IGNORE 35 | outputPrefixes: 36 | releaseFile: ab-example 37 | releaseDir: ab-example 38 | addons: 39 | notYetAlignedFromDependencyTree: 40 | 41 | -------------------------------------------------------------------------------- /experimental/src/test/java/org/jboss/bacon/experimental/impl/dependencies/DependencyResultTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.bacon.experimental.impl.dependencies; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import java.util.HashSet; 6 | 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class DependencyResultTest { 10 | 11 | private static final Project generateProject(final String groupArtifactId, final String version) { 12 | Project project = new Project(); 13 | project.setName(String.format("%s:%s", groupArtifactId, version)); 14 | project.setSourceCodeURL(String.format("%s:%s", groupArtifactId, version)); 15 | project.setSourceCodeRevision(version); 16 | return project; 17 | } 18 | 19 | @Test 20 | void addProjects() { 21 | HashSet projects = new HashSet(); 22 | projects.add(generateProject("foo:bar", "1.0.0")); 23 | projects.add(generateProject("foo:bar", "0.0.1")); 24 | projects.add(generateProject("baz:qux", "1.0.0")); 25 | assertThat(projects.size()).isEqualTo(3); 26 | DependencyResult dr = new DependencyResult(); 27 | dr.setTopLevelProjects(projects); 28 | assertThat(dr.getTopLevelProjects().size()).isEqualTo(3); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /experimental/src/test/resources/config/config-missing-gavExclusionUrl.yaml: -------------------------------------------------------------------------------- 1 | # ############################################################################## 2 | # 3 | # Config for bacon 4 | # 5 | # All urls are the base paths only. 6 | # 7 | # e.g USE http://example.co 8 | # 9 | # as opposed to: 10 | # 11 | # http://example.com/path 12 | # 13 | # ############################################################################## 14 | 15 | # ****************************************************************************** 16 | # PNC details 17 | # 18 | # ****************************************************************************** 19 | profile: 20 | - name: "default" 21 | pnc: 22 | url: "http://localhost:45656/pnc-rest/v2/" 23 | bifrostBaseurl: "http://example.com" 24 | 25 | # ****************************************************************************** 26 | # Authentication information 27 | # 28 | # Uncomment this section if you want to create / update / delete 29 | # ****************************************************************************** 30 | 31 | keycloak: 32 | url: "${keycloak-url}" 33 | realm: "${keycloak-realm}" 34 | username: "${keycloak-user}" 35 | clientSecret: "${keycloak-secret}" 36 | 37 | pig: 38 | kojiHubUrl: "http://koji.url" 39 | licenseServiceUrl: "http://license.url" 40 | indyUrl: "http://indy.url" 41 | da: 42 | url: "http://localhost:45656" 43 | -------------------------------------------------------------------------------- /experimental/src/test/resources/excluded-empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/experimental/src/test/resources/excluded-empty.txt -------------------------------------------------------------------------------- /experimental/src/test/resources/excluded-sample.txt: -------------------------------------------------------------------------------- 1 | io.vertx:vertx-amqp-client:4.3.7 2 | io.vertx:vertx-ext:38 3 | junit:junit:4.13.2 4 | io.vertx:vertx-proton:4.3.7 5 | io.vertx:vertx-ext:38 6 | junit:junit:4.13.2 7 | io.vertx:vertx-core:4.3.7 8 | io.vertx:vertx-dependencies:4.3.7 9 | io.vertx:vertx-core:4.3.7 10 | io.vertx:vertx-dependencies:4.3.7 11 | io.vertx:vertx-codegen:4.3.7 12 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-autobuild-gavexclusion-sample.txt: -------------------------------------------------------------------------------- 1 | io.vertx:vertx-amqp-client:4.3.7 2 | io.vertx:vertx-ext:38 3 | io.vertx:vertx-proton:4.3.7 4 | io.vertx:vertx-ext:38 5 | junit:junit:4.13.2 6 | io.vertx:vertx-core:4.3.7 7 | io.vertx:vertx-dependencies:4.3.7 8 | io.vertx:vertx-core:4.3.7 9 | io.vertx:vertx-dependencies:4.3.7 10 | io.vertx:vertx-codegen:4.3.7 11 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-built.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "built", 5 | "version": "1.2.3", 6 | "availableVersions": ["1.2.3.redhat-00001"] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-exactMatch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "com.sun.xml.bind", 4 | "artifactId": "jaxb-bom-ext", 5 | "version": "2.3.3-b02", 6 | "availableVersions": ["2.3.3.b02-redhat-00004"] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-managed-temp.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "managed", 5 | "version": "1.2.3", 6 | "availableVersions": [] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-managed.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "managed", 5 | "version": "1.2.3", 6 | "availableVersions": [] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-notbuilt-temp.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "notbuilt", 5 | "version": "1.2.3", 6 | "availableVersions": [] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-notbuilt.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "notbuilt", 5 | "version": "1.2.3", 6 | "availableVersions": [] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-temporary-temp.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "temporary", 5 | "version": "1.2.3", 6 | "availableVersions": ["1.2.3.temporary-redhat-00001"] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-da-rest-v-1-lookup-maven-versions-temporary.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "groupId": "foo.bar", 4 | "artifactId": "temporary", 5 | "version": "1.2.3", 6 | "availableVersions": [] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-pnc-rest-v2-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "pageIndex": 0, 3 | "pageSize": 50, 4 | "totalPages": 1, 5 | "totalHits": 1, 6 | "content": [ 7 | { 8 | "id": "100", 9 | "identifier": "foo.bar:built:1.2.3.redhat-0001", 10 | "purl": null, 11 | "artifactQuality": "NEW", 12 | "buildCategory": "STANDARD", 13 | "md5": "4af310bf0ef67bc7d143f35818ea1ed2", 14 | "sha1": "3a8ff25c890f2a4a283876a91037ff6c57474a14", 15 | "sha256": "1660168483cb8a05d1cc2e77c861682a42ed9517ba945159d5538950c5db00fa", 16 | "filename": "demo built artifact 1", 17 | "deployPath": null, 18 | "importDate": null, 19 | "originUrl": null, 20 | "size": 10, 21 | "deployUrl": "", 22 | "publicUrl": "", 23 | "creationTime": null, 24 | "modificationTime": null, 25 | "qualityLevelReason": null, 26 | "targetRepository": { 27 | "id": "100", 28 | "temporaryRepo": false, 29 | "identifier": "indy-maven", 30 | "repositoryType": "MAVEN", 31 | "repositoryPath": "builds-untested" 32 | }, 33 | "build": { 34 | "id": "AAABUILT01", 35 | "buildConfigRevision": { 36 | "id": "100", 37 | "rev": 100 38 | } 39 | }, 40 | "creationUser": null, 41 | "modificationUser": null 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-pnc-rest-v2-build-configs-empty-page.json: -------------------------------------------------------------------------------- 1 | { 2 | "pageIndex": 0, 3 | "pageSize": 50, 4 | "totalPages": 0, 5 | "totalHits": 0, 6 | "content": [ ] 7 | } 8 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-pnc-rest-v2-builds-AAABUILT01-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "pageIndex": 0, 3 | "pageSize": 50, 4 | "totalPages": 1, 5 | "totalHits": 3, 6 | "content": [ 7 | { 8 | "id": "100", 9 | "identifier": "foo.bar:built:pom:1.2.3.redhat-00001", 10 | "deployPath": null, 11 | "targetRepository": { 12 | "id": "100", 13 | "repositoryType": "MAVEN" 14 | }, 15 | "build": { 16 | "id": "AAABUILT01", 17 | "buildConfigRevision": { 18 | "id": "100", 19 | "rev": 100 20 | } 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-pnc-rest-v2-builds-AAATEMP01-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "pageIndex": 0, 3 | "pageSize": 50, 4 | "totalPages": 1, 5 | "totalHits": 3, 6 | "content": [ 7 | { 8 | "id": "100", 9 | "identifier": "foo.bar:temporary:pom:1.2.3.temporary-redhat-00001", 10 | "deployPath": null, 11 | "targetRepository": { 12 | "id": "100", 13 | "repositoryType": "MAVEN" 14 | }, 15 | "build": { 16 | "id": "AAATEMP01", 17 | "buildConfigRevision": { 18 | "id": "100", 19 | "rev": 100 20 | } 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-pnc-rest-v2-builds-exactMatch-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "pageIndex": 0, 3 | "pageSize": 50, 4 | "totalPages": 1, 5 | "totalHits": 1, 6 | "content": [ 7 | { 8 | "id": "10246664", 9 | "identifier": "dcom.sun.xml.bind:jaxb-bom-ext:pom:2.3.3.b02-redhat-00004", 10 | "deployPath": null, 11 | "targetRepository": { 12 | "id": "100", 13 | "repositoryType": "MAVEN" 14 | }, 15 | "build": { 16 | "id": "EXACTMATCH1", 17 | "buildConfigRevision": { 18 | "id": "10246", 19 | "rev": 10246 20 | } 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/__files/body-pnc-rest-v2-generic-setting-announcement-banner-1BYXE.json: -------------------------------------------------------------------------------- 1 | {"banner":""} 2 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-autobuild-gavexclusion-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "bc7a1bf8-5ecb-4f66-a52d-ce195259540d", 3 | "request" : { 4 | "url" : "/autobuild/gavexclusion/excluded.txt", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-autobuild-gavexclusion-sample.txt", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "text/plain", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "46bdc487-02cf-4c46-bc8c-67922552bdaf" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0001-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"built\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-built.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0001-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-exactMatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-fad9-488a-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"PERSISTENT\",\"artifacts\":[{\"groupId\":\"com.sun.xml.bind\",\"artifactId\":\"jaxb-bom-ext\",\"version\":\"2.3.3-b02\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-exactMatch.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-fad9-488a-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-managed-temp.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0007-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"TEMPORARY_PREFER_PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"managed\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-managed-temp.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0007-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-managed.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0006-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"managed\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-managed.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0006-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-notbuilt-temp.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0005-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"TEMPORARY_PREFER_PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"notbuilt\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-notbuilt-temp.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0005-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-notbuilt.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0004-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"notbuilt\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-notbuilt.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0004-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-temporary-temp.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0003-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"TEMPORARY_PREFER_PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"temporary\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-temporary-temp.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0003-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-da-rest-v-1-lookup-maven-versions-temporary.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0002-8642-b2ad-8bab1274c4be", 3 | "request" : { 4 | "url" : "/da/rest/v-1/lookup/maven/versions", 5 | "method" : "POST", 6 | "bodyPatterns" : [ { 7 | "equalToJson" : "{\"filter\":\"ALL\",\"distanceRule\":\"CLOSEST_BY_PARTS\",\"mode\":\"PERSISTENT\",\"artifacts\":[{\"groupId\":\"foo.bar\",\"artifactId\":\"temporary\",\"version\":\"1.2.3\"}],\"includeBad\":false,\"brewPullActive\":false}", 8 | "ignoreArrayOrder" : true, 9 | "ignoreExtraElements" : true 10 | } ] 11 | }, 12 | "response" : { 13 | "status" : 200, 14 | "bodyFileName" : "body-da-rest-v-1-lookup-maven-versions-temporary.json", 15 | "headers" : { 16 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 17 | "date" : "Tue, 20 Dec 2022 19:10:32 GMT", 18 | "access-control-allow-origin" : "*", 19 | "access-control-allow-credentials" : "true", 20 | "content-type" : "application/json", 21 | "access-control-max-age" : "1", 22 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 23 | } 24 | }, 25 | "uuid" : "54b9e1c8-0002-8642-b2ad-8bab1274c4be" 26 | } 27 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-100.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "bb394f89-3037-3dd2-ae5b-1ce6ad56774a", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Ddependency-two%3Abar%3Apom%3A2.3.2.redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-100.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:21:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "bb394f89-3037-3dd2-ae5b-1ce6ad56774a" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-200.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "0f9b2292-d4c8-33df-bfae-f64f0e696be5", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Ddependency-one%3Abar%3Apom%3A2.3.2.redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-200.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:47:05 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "0f9b2292-d4c8-33df-bfae-f64f0e696be5" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-300.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "88148ab5-612f-3260-87d4-962d92dcb686", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Dtoplevel-one%3Abar%3Apom%3A2.3.2.redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-300.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:56:30 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "88148ab5-612f-3260-87d4-962d92dcb686" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-400.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "88148ab5-612f-3260-0400-962d92dcb686", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Dtoplevel-two%3Abar%3Apom%3A2.3.2.redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-300.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:56:30 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "88148ab5-612f-3260-0400-962d92dcb686" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-500.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "88148ab5-612f-3260-0500-962d92dcb686", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Ddependency-common%3Abar%3Apom%3A2.3.2.redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-500.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:56:30 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "88148ab5-612f-3260-0500-962d92dcb686" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0003-8642-1a45-8bab1274c4be", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Dfoo.bar%3Abuilt%3Apom%3A1.2.3.redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:21:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "54b9e1c8-0001-8642-1a45-8bab1274c4be" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-exactMatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "a070dc45-be4b-464d-a235-146e0b89530c", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Dcom.sun.xml.bind%3Ajaxb-bom-ext%3Apom%3A2.3.3.b02-redhat-00004%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-exactMatch.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:21:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "a070dc45-be4b-464d-a235-146e0b89530c" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-artifacts-temporary.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0003-8642-1a45-8bab1274c4be", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/artifacts?pageSize=50&pageIndex=0&q=identifier%3D%3Dfoo.bar%3Atemporary%3Apom%3A1.2.3.temporary-redhat-00001%3Bbuild%3Disnull%3Dfalse", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:21:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "54b9e1c8-0003-8642-1a45-8bab1274c4be" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-100-revisions-100.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-87f8-30ca-8bef-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/100/revisions/100", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-100-revisions-100.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-87f8-30ca-8bef-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-100-revisions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d1e6f9f8-1234-30ca-8bef-8c72a0525606", 3 | "request": { 4 | "url": "/pnc-rest/v2/build-configs/100/revisions?pageSize=50&pageIndex=0", 5 | "method": "GET" 6 | }, 7 | "response": { 8 | "status": 200, 9 | "bodyFileName": "body-pnc-rest-v2-build-configs-100-revisions.json", 10 | "headers": { 11 | "access-control-allow-headers": "accept, authorization, content-type, x-requested-with", 12 | "date": "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin": "*", 14 | "access-control-allow-credentials": "true", 15 | "content-type": "application/json", 16 | "access-control-max-age": "1", 17 | "access-control-allow-methods": "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid": "d1e6f9f8-1234-30ca-8bef-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-100.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-6977-30ca-0100-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/100", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-100.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-6977-30ca-0100-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-200-revisions-200.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-87f8-30ca-0200-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/200/revisions/200", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-200-revisions-200.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-87f8-30ca-0200-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-200-revisions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d1e6f9f8-1234-30ca-0200-8c72a0525606", 3 | "request": { 4 | "url": "/pnc-rest/v2/build-configs/200/revisions?pageSize=50&pageIndex=0", 5 | "method": "GET" 6 | }, 7 | "response": { 8 | "status": 200, 9 | "bodyFileName": "body-pnc-rest-v2-build-configs-200-revisions.json", 10 | "headers": { 11 | "access-control-allow-headers": "accept, authorization, content-type, x-requested-with", 12 | "date": "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin": "*", 14 | "access-control-allow-credentials": "true", 15 | "content-type": "application/json", 16 | "access-control-max-age": "1", 17 | "access-control-allow-methods": "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid": "d1e6f9f8-1234-30ca-0200-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-200.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-6977-30ca-0200-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/200", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-200.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-6977-30ca-0200-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-300-revisions-300.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-87f8-30ca-0300-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/300/revisions/300", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-300-revisions-300.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-87f8-30ca-0300-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-300-revisions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d1e6f9f8-1234-30ca-0300-8c72a0525606", 3 | "request": { 4 | "url": "/pnc-rest/v2/build-configs/300/revisions?pageSize=50&pageIndex=0", 5 | "method": "GET" 6 | }, 7 | "response": { 8 | "status": 200, 9 | "bodyFileName": "body-pnc-rest-v2-build-configs-300-revisions.json", 10 | "headers": { 11 | "access-control-allow-headers": "accept, authorization, content-type, x-requested-with", 12 | "date": "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin": "*", 14 | "access-control-allow-credentials": "true", 15 | "content-type": "application/json", 16 | "access-control-max-age": "1", 17 | "access-control-allow-methods": "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid": "d1e6f9f8-1234-30ca-0300-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-300.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-6977-30ca-0300-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/300", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-300.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-6977-30ca-0300-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-400-revisions-400.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-87f8-30ca-0400-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/400/revisions/400", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-400-revisions-400.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-87f8-30ca-0400-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-400-revisions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d1e6f9f8-1234-30ca-0400-8c72a0525606", 3 | "request": { 4 | "url": "/pnc-rest/v2/build-configs/400/revisions?pageSize=50&pageIndex=0", 5 | "method": "GET" 6 | }, 7 | "response": { 8 | "status": 200, 9 | "bodyFileName": "body-pnc-rest-v2-build-configs-400-revisions.json", 10 | "headers": { 11 | "access-control-allow-headers": "accept, authorization, content-type, x-requested-with", 12 | "date": "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin": "*", 14 | "access-control-allow-credentials": "true", 15 | "content-type": "application/json", 16 | "access-control-max-age": "1", 17 | "access-control-allow-methods": "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid": "d1e6f9f8-1234-30ca-0400-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-400.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-6977-30ca-0400-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/400", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-400.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-6977-30ca-0400-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-500-revisions-500.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-87f8-30ca-0500-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/500/revisions/500", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-500-revisions-500.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-87f8-30ca-0500-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-500-revisions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "d1e6f9f8-1234-30ca-0500-8c72a0525606", 3 | "request": { 4 | "url": "/pnc-rest/v2/build-configs/500/revisions?pageSize=50&pageIndex=0", 5 | "method": "GET" 6 | }, 7 | "response": { 8 | "status": 200, 9 | "bodyFileName": "body-pnc-rest-v2-build-configs-500-revisions.json", 10 | "headers": { 11 | "access-control-allow-headers": "accept, authorization, content-type, x-requested-with", 12 | "date": "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin": "*", 14 | "access-control-allow-credentials": "true", 15 | "content-type": "application/json", 16 | "access-control-max-age": "1", 17 | "access-control-allow-methods": "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid": "d1e6f9f8-1234-30ca-0500-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-500.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "d1e6f9f8-6977-30ca-0500-8c72a0525606", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/500", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-500.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "d1e6f9f8-6977-30ca-0500-8c72a0525606" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-empty-page.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "abc456da-0007-3dd2-fa68-1ce6ad56774a", 3 | "priority": 1000, 4 | "request" : { 5 | "urlPattern" : "/pnc-rest/v2/build-configs\\?pageSize=50&pageIndex=0&q=name%3D%3D[a-z0-9.-]+-AUTOBUILDER", 6 | "method" : "GET" 7 | }, 8 | "response" : { 9 | "status" : 200, 10 | "bodyFileName" : "body-pnc-rest-v2-build-configs-empty-page.json", 11 | "headers" : { 12 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 13 | "date" : "Tue, 20 Dec 2022 19:21:34 GMT", 14 | "access-control-allow-origin" : "*", 15 | "access-control-allow-credentials" : "true", 16 | "content-type" : "application/json", 17 | "access-control-max-age" : "1", 18 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 19 | } 20 | }, 21 | "uuid" : "abc456da-0007-3dd2-fa68-1ce6ad56774a" 22 | } 23 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-exactMatch-revisions-exactMatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "770427d4-aece-47d6-a8e1-064845ef2683", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/10246/revisions/10246", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-exactMatch-revisions-exactMatch.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "770427d4-aece-47d6-a8e1-064845ef2683" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-exactMatch-revisions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "1c488763-d2ff-4e18-8987-1fc30a90b299", 3 | "request": { 4 | "url": "/pnc-rest/v2/build-configs/10246/revisions?pageSize=50&pageIndex=0", 5 | "method": "GET" 6 | }, 7 | "response": { 8 | "status": 200, 9 | "bodyFileName": "body-pnc-rest-v2-build-configs-exactMatch-revisions.json", 10 | "headers": { 11 | "access-control-allow-headers": "accept, authorization, content-type, x-requested-with", 12 | "date": "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin": "*", 14 | "access-control-allow-credentials": "true", 15 | "content-type": "application/json", 16 | "access-control-max-age": "1", 17 | "access-control-allow-methods": "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid": "1c488763-d2ff-4e18-8987-1fc30a90b299" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-exactMatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "2276ddc7-f384-4a39-bba9-8b3496848a32", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs/10246", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-exactMatch.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:18 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "2276ddc7-f384-4a39-bba9-8b3496848a32" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-build-configs-managed.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "abc456da-0007-3dd2-ae5b-1ce6ad56774a", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/build-configs?pageSize=50&pageIndex=0&q=name%3D%3Dfoo.bar-managed-1.2.3-AUTOBUILDER", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-build-configs-managed.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:21:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "abc456da-0007-3dd2-ae5b-1ce6ad56774a" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAAAA1-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "e9636910-a6fb-328d-895b-e865ba2ed978", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAAAA1/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAAAA1-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:17 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "e9636910-a6fb-328d-895b-e865ba2ed978" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAAAA2-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "678343c6-9b89-32ef-a2a9-7fa37b57da3b", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAAAA2/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAAAA2-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:49:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "678343c6-9b89-32ef-a2a9-7fa37b57da3b" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAAAA3-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "678343c6-9b89-32ef-0300-7fa37b57da3b", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAAAA3/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAAAA3-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:49:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "678343c6-9b89-32ef-0300-7fa37b57da3b" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAAAA4-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "678343c6-9b89-32ef-0400-7fa37b57da3b", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAAAA4/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAAAA4-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:49:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "678343c6-9b89-32ef-0400-7fa37b57da3b" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAAAA5-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "678343c6-9b89-32ef-0500-7fa37b57da3b", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAAAA5/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAAAA5-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:49:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "678343c6-9b89-32ef-0500-7fa37b57da3b" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAABUILT01-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0001-8642-d8af-8bab1274c4be", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAABUILT01/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAABUILT01-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:49:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "54b9e1c8-0001-8642-d8af-8bab1274c4be" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-AAATEMP01-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "54b9e1c8-0003-8642-d8af-8bab1274c4be", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/AAATEMP01/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-AAATEMP01-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:49:34 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "54b9e1c8-0003-8642-d8af-8bab1274c4be" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-builds-exactMatch-artifacts-built.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "dd7d9088-8c1b-4376-8108-16715a6f6a53", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/builds/EXACTMATCH1/artifacts/built?pageSize=50&pageIndex=0", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-builds-exactMatch-artifacts-built.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:23:17 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "dd7d9088-8c1b-4376-8108-16715a6f6a53" 21 | } 22 | -------------------------------------------------------------------------------- /experimental/src/test/resources/wiremock/mappings/mapping-pnc-rest-v2-generic-setting-announcement-banner-1BYXE.json: -------------------------------------------------------------------------------- 1 | { 2 | "id" : "af08bc2d-d251-3d61-b7b7-c3aa33394aa2", 3 | "request" : { 4 | "url" : "/pnc-rest/v2/generic-setting/announcement-banner", 5 | "method" : "GET" 6 | }, 7 | "response" : { 8 | "status" : 200, 9 | "bodyFileName" : "body-pnc-rest-v2-generic-setting-announcement-banner-1BYXE.json", 10 | "headers" : { 11 | "access-control-allow-headers" : "accept, authorization, content-type, x-requested-with", 12 | "date" : "Tue, 20 Dec 2022 19:05:29 GMT", 13 | "access-control-allow-origin" : "*", 14 | "access-control-allow-credentials" : "true", 15 | "content-type" : "application/json", 16 | "access-control-max-age" : "1", 17 | "access-control-allow-methods" : "GET, POST, OPTIONS, PUT, DELETE, PATCH" 18 | } 19 | }, 20 | "uuid" : "af08bc2d-d251-3d61-b7b7-c3aa33394aa2" 21 | } 22 | -------------------------------------------------------------------------------- /integration-tests/src/test/java/org/jboss/pnc/bacon/test/Endpoints.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.test; 2 | 3 | import java.util.function.Function; 4 | 5 | /** 6 | * 7 | * @author jbrazdil 8 | */ 9 | public class Endpoints { 10 | 11 | public static final String PRODUCT = "/products"; 12 | public static final Function PRODUCT_VERSIONS = id -> PRODUCT + "/" + id + "/versions"; 13 | public static final String PRODUCT_MILESTONE = "/product-milestones"; 14 | public static final String SCM_REPOSITORY = "/scm-repositories"; 15 | public static final String SCM_REPOSITORY_CREATE = "/scm-repositories/create-and-sync"; 16 | public static final String PROJECT = "/projects"; 17 | public static final String ENVIRONMENT = "/environments"; 18 | public static final String BUILD_CONFIG = "/build-configs"; 19 | public static final Function BUILD_CONFIG_DEPENDENCIES = id -> BUILD_CONFIG + "/" + id 20 | + "/dependencies"; 21 | public static final String GROUP_CONFIG = "/group-configs"; 22 | public static final Function GROUP_CONFIG_BUILD_CONFIGS = id -> GROUP_CONFIG + "/" + id 23 | + "/build-configs"; 24 | public static final String PRODUCT_VERSION = "/product-versions"; 25 | public static final Function PRODUCT_VERSION_MILESTONES = id -> PRODUCT_VERSION + "/" + id 26 | + "/milestones"; 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/src/test/java/org/jboss/pnc/bacon/test/TestType.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.test; 2 | 3 | /** 4 | * If a test is supposed to be executed either only with mocks or only with real service, add one of the tags to the 5 | * test 6 | * 7 | * If the test should run regardless of environment, no tag is required 8 | */ 9 | public class TestType { 10 | public static final String MOCK_ONLY = "MockOnly"; 11 | public static final String REAL_SERVICE_ONLY = "RealServiceOnly"; 12 | 13 | private TestType() { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /integration-tests/src/test/java/org/jboss/pnc/bacon/test/da/DAMavenLatestTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.test.da; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.jboss.pnc.bacon.test.CLIExecutor; 6 | import org.jboss.pnc.bacon.test.ExecutionResult; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.api.TestInstance; 9 | 10 | @TestInstance(TestInstance.Lifecycle.PER_CLASS) 11 | public class DAMavenLatestTest { 12 | 13 | @Test 14 | void testMavenLatestGAVsSpecified() { 15 | ExecutionResult result = CLIExecutor.runCommand("da", "lookup", "maven-latest"); 16 | assertThat(result.getError()).contains("You didn't specify any GAVs or file!"); 17 | assertThat(result.getRetval()).isNotZero(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources/config/config.yaml: -------------------------------------------------------------------------------- 1 | # ############################################################################## 2 | # 3 | # Config for bacon 4 | # 5 | # All urls are the base paths only. 6 | # 7 | # e.g USE http://example.co 8 | # 9 | # as opposed to: 10 | # 11 | # http://example.com/path 12 | # 13 | # ############################################################################## 14 | 15 | # ****************************************************************************** 16 | # PNC details 17 | # 18 | # ****************************************************************************** 19 | profile: 20 | - name: "default" 21 | pnc: 22 | url: "${pnc-url}" 23 | bifrostBaseurl: "http://example.com" 24 | 25 | # ****************************************************************************** 26 | # Authentication information 27 | # 28 | # Uncomment this section if you want to create / update / delete 29 | # ****************************************************************************** 30 | 31 | keycloak: 32 | url: "${keycloak-url}" 33 | realm: "${keycloak-realm}" 34 | username: "${keycloak-user}" 35 | clientSecret: "${keycloak-secret}" 36 | 37 | pig: 38 | kojiHubUrl: "http://koji.url" 39 | licenseServiceUrl: "http://license.url" 40 | indyUrl: "http://indy.url" 41 | da: 42 | url: "da.url" 43 | 44 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources/empty/build-config.yaml: -------------------------------------------------------------------------------- 1 | #!suffix=should-be-overriden 2 | # at the moment not used in code, used for manual testing 3 | product: 4 | name: FTProduct {{suffix}} 5 | abbreviation: empty-{{suffix}} 6 | stage: GA 7 | version: 2.2.0 8 | milestone: DR4 9 | #releaseStorageUrl: http://rcm-guest.app.eng.bos.redhat.com/rcm-guest/staging/quarkus/tmp/empty 10 | group: test-{{suffix}} 11 | defaultBuildParameters: 12 | environmentId: 3 13 | buildScript: mvn clean deploy -DskipTests 14 | builds: 15 | - name: michalszynkiewicz-et-{{suffix}} 16 | project: Empty 17 | buildScript: mvn clean deploy 18 | scmUrl: https://github.com/michalszynkiewicz/empty.git 19 | scmRevision: 1.0.11 20 | 21 | - name: michalszynkiewicz-et2-{{suffix}} 22 | project: Empty 23 | buildScript: mvn clean deploy -DskipTests -B 24 | scmUrl: https://github.com/michalszynkiewicz/empty2.git 25 | scmRevision: 1.0.11 26 | dependencies: 27 | - michalszynkiewicz-et-{{suffix}} 28 | outputPrefixes: 29 | releaseFile: rhoar-empty 30 | releaseDir: empty 31 | flow: 32 | licensesGeneration: 33 | strategy: GENERATE 34 | repositoryGeneration: 35 | strategy: BUILD_CONFIGS 36 | sourceBuilds: 37 | - michalszynkiewicz-et-{{suffix}} 38 | javadocGeneration: 39 | strategy: IGNORE 40 | -------------------------------------------------------------------------------- /integration-tests/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/GavFinder.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.licenses; 2 | 3 | import java.nio.file.Path; 4 | import java.util.Collection; 5 | import java.util.Set; 6 | import java.util.stream.Collectors; 7 | import java.util.stream.Stream; 8 | 9 | import org.apache.maven.artifact.Artifact; 10 | import org.apache.maven.project.MavenProject; 11 | import org.jboss.pnc.bacon.licenses.maven.MavenProjectFactory; 12 | import org.jboss.pnc.bacon.licenses.utils.Gav; 13 | 14 | public class GavFinder { 15 | private final MavenProjectFactory mavenProjectFactory; 16 | 17 | GavFinder(MavenProjectFactory mavenProjectFactory) { 18 | this.mavenProjectFactory = mavenProjectFactory; 19 | } 20 | 21 | public Collection inMavenProject(Path pomPath) { 22 | return getArtifactsForMavenProject(pomPath) 23 | .map(a -> new Gav(a.getGroupId(), a.getArtifactId(), a.getVersion(), a.getType())) 24 | .collect(Collectors.toSet()); 25 | } 26 | 27 | Stream getArtifactsForMavenProject(Path pomPath) { 28 | return mavenProjectFactory.getMavenProjects(pomPath.toFile(), true) 29 | .stream() 30 | .map(MavenProject::getArtifacts) 31 | .flatMap(Set::stream); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/LicensesGeneratorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses; 18 | 19 | /** 20 | * @author Gytis Trikleris 21 | */ 22 | public class LicensesGeneratorException extends Exception { 23 | 24 | public LicensesGeneratorException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/maven/MavenProjectFactoryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.maven; 18 | 19 | /** 20 | * @author Gytis Trikleris 21 | */ 22 | public class MavenProjectFactoryException extends Exception { 23 | 24 | public MavenProjectFactoryException(Throwable cause) { 25 | super(cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/properties/GeneratorPropertiesException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.properties; 18 | 19 | /** 20 | * @author Gytis Trikleris 21 | */ 22 | public class GeneratorPropertiesException extends RuntimeException { 23 | 24 | public GeneratorPropertiesException(String message) { 25 | super(message); 26 | } 27 | 28 | public GeneratorPropertiesException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/properties/PropertyKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.properties; 18 | 19 | /** 20 | * @author Gytis Trikleris 21 | */ 22 | public interface PropertyKeys { 23 | 24 | String REPOSITORY_NAMES = "repository.names"; 25 | 26 | String REPOSITORY_URLS = "repository.urls"; 27 | 28 | String LICENSE_SERVICE_URL = "licenseServiceUrl"; 29 | 30 | String ALIASES_FILE = "aliasesFile"; 31 | 32 | String EXCEPTIONS_FILE = "exceptionsFile"; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/sanitiser/LicenseSanitiser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.sanitiser; 18 | 19 | import org.jboss.pnc.bacon.licenses.xml.DependencyElement; 20 | 21 | /** 22 | * @author Gytis Trikleris 23 | */ 24 | public interface LicenseSanitiser { 25 | 26 | DependencyElement fix(DependencyElement dependencyElement); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/sanitiser/NoopLicenseSanitiser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.sanitiser; 18 | 19 | import org.jboss.pnc.bacon.licenses.xml.DependencyElement; 20 | 21 | /** 22 | * @author Gytis Trikleris 23 | */ 24 | public class NoopLicenseSanitiser implements LicenseSanitiser { 25 | 26 | @Override 27 | public DependencyElement fix(DependencyElement dependencyElement) { 28 | return dependencyElement; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/sanitiser/exceptions/ExactVersionMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.sanitiser.exceptions; 18 | 19 | import java.util.Objects; 20 | 21 | class ExactVersionMatcher implements VersionMatcher { 22 | private final String version; 23 | 24 | ExactVersionMatcher(String version) { 25 | this.version = Objects.requireNonNull(version, "version must be set"); 26 | } 27 | 28 | @Override 29 | public boolean matches(String version) { 30 | return this.version.equals(version); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/sanitiser/exceptions/RegexpVersionMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.sanitiser.exceptions; 18 | 19 | import java.util.Objects; 20 | import java.util.regex.Pattern; 21 | 22 | class RegexpVersionMatcher implements VersionMatcher { 23 | private final Pattern regexp; 24 | 25 | RegexpVersionMatcher(String regexp) { 26 | this.regexp = Pattern.compile(Objects.requireNonNull(regexp, "version regexp must be set")); 27 | } 28 | 29 | @Override 30 | public boolean matches(String version) { 31 | if (version == null) { 32 | return false; 33 | } 34 | return this.regexp.matcher(version).matches(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/sanitiser/exceptions/VersionMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.jboss.pnc.bacon.licenses.sanitiser.exceptions; 18 | 19 | public interface VersionMatcher { 20 | boolean matches(String version); 21 | } 22 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/sanitiser/provider/ExternalLicensesDto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 Red Hat, Inc, and individual contributors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.jboss.pnc.bacon.licenses.sanitiser.provider; 17 | 18 | import java.util.Set; 19 | 20 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 21 | 22 | /** 23 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com 24 | */ 25 | @JsonIgnoreProperties(ignoreUnknown = true) 26 | public class ExternalLicensesDto { 27 | private Set licenses; 28 | 29 | public Set getLicenses() { 30 | return licenses; 31 | } 32 | 33 | public void setLicenses(Set licenses) { 34 | this.licenses = licenses; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /licenses-generator/src/main/java/org/jboss/pnc/bacon/licenses/xml/OfflineLicenseMirror.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.licenses.xml; 2 | 3 | import java.io.InputStream; 4 | import java.net.URI; 5 | import java.util.Optional; 6 | 7 | /** 8 | * Offline License Mirror implementation 9 | * 10 | * The mirror is in the 'src/main/resources' folder, in path OFFLINE_LICENSE_MIRROR_RESOURCE_FOLDER 11 | * The structure of the mirror is: server/path1/path2/license.html 12 | * It tries to mimic the exact same path as the url, minus the scheme part (http) 13 | */ 14 | public class OfflineLicenseMirror { 15 | 16 | /** 17 | * Folder in the src/main/resources folder where to find the offline mirror for licenses 18 | */ 19 | public static final String OFFLINE_LICENSE_MIRROR_RESOURCE_FOLDER = "offline-license-mirror"; 20 | 21 | public static Optional find(String url) { 22 | 23 | // try to parse the url to extract values 24 | URI uri = URI.create(url); 25 | 26 | // As a path separator for getResourceAsStream, we should always use a slash (“/”), not what the OS specific one uses. 27 | // Thanks to @aloubyansky for pointing this out 28 | String resourcesPathOfLicense = OFFLINE_LICENSE_MIRROR_RESOURCE_FOLDER + "/" + uri.getAuthority() 29 | + uri.getPath(); 30 | 31 | InputStream input = OfflineLicenseMirror.class.getClassLoader() 32 | .getResourceAsStream(resourcesPathOfLicense); 33 | return Optional.ofNullable(input); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/generator.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/licenses-generator/src/main/resources/generator.properties -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/licenses.qute: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 |

The following material has been provided for informational purposes only, and should not be relied upon or 29 | construed as a legal opinion or legal advice.

30 | 31 | 32 | 33 | 34 | {#for dependency in dependencies} 35 | 36 | 37 | 38 | 39 | 45 | 53 | 54 | {/for} 55 |
Package GroupPackage ArtifactPackage VersionRemote LicensesLocal Licenses
{dependency.groupId}{dependency.artifactId}{dependency.version} 40 | {#for license in dependency.licenses} 41 | {license.name} 42 |
43 | {/for} 44 |
46 | {#for license in dependency.licenses} 47 | {#if licenseFiles.containsKey(license.name)} 48 | {license.name} 49 |
50 | {/if} 51 | {/for} 52 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/README.md: -------------------------------------------------------------------------------- 1 | Generated using: 2 | ``` 3 | wget -r --no-parent https://www.apache.org/licenses 4 | wget -r --no-parent https://repository.jboss.org/licenses 5 | wget -r --no-parent https://www.gnu.org/licenses/old-licenses 6 | ``` 7 | 8 | and removing any unecessary files, like translations, pdfs, etc. 9 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/antlr.txt: -------------------------------------------------------------------------------- 1 | http://www.antlr.org/license.html 2 | 3 | Software License 4 | 5 | We reserve no legal rights to the ANTLR--it is fully in the public domain. An 6 | individual or company may do whatever they wish with source code distributed 7 | with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, 8 | or its output, into commerical software. 9 | 10 | We encourage users to develop software with ANTLR. However, we do ask that 11 | credit is given to us for developing ANTLR. By "credit", we mean that if you 12 | use ANTLR or incorporate any source code into one of your programs (commercial 13 | product, research project, or otherwise) that you acknowledge this fact 14 | somewhere in the documentation, research report, etc... If you like ANTLR and 15 | have developed a nice tool with the output, please mention that you developed 16 | it using ANTLR. In addition, we ask that the headers remain intact in our 17 | source code. As long as these guidelines are kept, we expect to continue 18 | enhancing this system and expect to make other tools available as they are 19 | completed. 20 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/bouncycastle.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/cc-public-domain-mark-1.0.txt: -------------------------------------------------------------------------------- 1 | 2 | No Copyright 3 | -------------- 4 | 5 | This work has been identified as being free of known restrictions under copyright law, including all related and neighboring rights. 6 | 7 | You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. See Other Information below. 8 | 9 | 10 | Other Information 11 | ----------------- 12 | 13 | * The work may not be free of known copyright restrictions in all jurisdictions. 14 | * Persons may have other rights in or related to the work, such as patent or trademark rights, and others may have rights in how the work is used, such as publicity or privacy rights. 15 | * In some jurisdictions moral rights of the author may persist beyond the term of copyright. These rights may include the right to be identified as the author and the right to object to derogatory treatments. 16 | * Unless expressly stated otherwise, the person who identified the work makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. 17 | * When using or citing the work, you should not imply endorsement by the author or the person who identified the work. 18 | 19 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/day-jcr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/day-jcr.txt -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/easymock.txt: -------------------------------------------------------------------------------- 1 | EasyMock License (MIT License) 2 | Copyright (c) 2001-2004 OFFIS 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/ehcache.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2006 Greg Luck 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/httpunit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/httpunit.txt -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/jcip-cc-by-2.5.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Brian Goetz and Tim Peierls 3 | * Released under the Creative Commons Attribution License 4 | * (http://creativecommons.org/licenses/by/2.5) 5 | * Official home: http://www.jcip.net 6 | * 7 | * Any republication or derived work distributed in source code form 8 | * must include this copyright and license notice. 9 | */ 10 | 11 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/jsr94_ri_license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/jsr94_ri_license.txt -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/mit.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 13 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 14 | OTHER DEALINGS IN THE SOFTWARE. 15 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/oswego.txt: -------------------------------------------------------------------------------- 1 | All classes are released to the public domain and may be used for any purpose 2 | whatsoever without permission or acknowledgment. Portions of the 3 | CopyOnWriteArrayList and ConcurrentReaderHashMap classes are adapted from Sun 4 | JDK source code. These are copyright of Sun Microsystems, Inc, and are used 5 | with their kind permission, as described in this license. 6 | http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/sun-u.c.license.pdf 7 | 8 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/repository.jboss.org/licenses/trove.txt: -------------------------------------------------------------------------------- 1 | The Trove library is licensed under the Lesser GNU Public License, 2 | which is included with the distribution in a file called LICENSE.txt. 3 | 4 | The PrimeFinder and HashFunctions classes in Trove are subject to the 5 | following license restrictions: 6 | 7 | Copyright (c) 1999 CERN - European Organization for Nuclear Research. 8 | 9 | Permission to use, copy, modify, distribute and sell this software and 10 | its documentation for any purpose is hereby granted without fee, 11 | provided that the above copyright notice appear in all copies and that 12 | both that copyright notice and this permission notice appear in 13 | supporting documentation. CERN makes no representations about the 14 | suitability of this software for any purpose. It is provided "as is" 15 | without expressed or implied warranty. 16 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/www.apache.org/licenses/NOTICE-2.0.txt: -------------------------------------------------------------------------------- 1 | Apache [PRODUCT_NAME] 2 | Copyright [XXXX-XXXX] The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/offline-license-mirror/www.apache.org/licenses/icla.txt: -------------------------------------------------------------------------------- 1 | The Apache iCLA form has moved to http://apache.org/licenses/icla.pdf 2 | -------------------------------------------------------------------------------- /licenses-generator/src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | org.slf4j.simpleLogger.defaultLogLevel=info 2 | org.slf4j.simpleLogger.log.me.snowdrop=info 3 | -------------------------------------------------------------------------------- /licenses-generator/src/test/java/org/jboss/pnc/bacon/licenses/sanitiser/NoopLicenseSanitiserTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.licenses.sanitiser; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import java.util.Collections; 6 | 7 | import org.jboss.pnc.bacon.licenses.xml.DependencyElement; 8 | import org.jboss.pnc.bacon.licenses.xml.LicenseElement; 9 | import org.junit.jupiter.api.Test; 10 | 11 | /** 12 | * @author Gytis Trikleris 13 | */ 14 | public class NoopLicenseSanitiserTest { 15 | 16 | @Test 17 | public void shouldDoNothing() { 18 | NoopLicenseSanitiser sanitiser = new NoopLicenseSanitiser(); 19 | DependencyElement dependencyElement = new DependencyElement( 20 | "testGroupId", 21 | "testArtifactId", 22 | "testVersion", 23 | Collections.singleton(new LicenseElement("testLicenseName", "testLicenseUrl"))); 24 | 25 | DependencyElement sanitisedDependencyElement = sanitiser.fix(dependencyElement); 26 | 27 | assertThat(sanitisedDependencyElement).isEqualTo(dependencyElement); 28 | assertThat(sanitisedDependencyElement.getLicenses()).isEqualTo(dependencyElement.getLicenses()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /licenses-generator/src/test/java/org/jboss/pnc/bacon/licenses/sanitiser/exceptions/ExactVersionMatcherTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.licenses.sanitiser.exceptions; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class ExactVersionMatcherTest { 8 | private VersionMatcher matcher = new ExactVersionMatcher("1.0.0"); 9 | 10 | @Test 11 | public void matchingString() throws Exception { 12 | assertThat(matcher.matches("1.0.0")).isTrue(); 13 | } 14 | 15 | @Test 16 | public void nonmatchingString() throws Exception { 17 | assertThat(matcher.matches("2.0.0")).isFalse(); 18 | } 19 | 20 | @Test 21 | public void nullString() throws Exception { 22 | assertThat(matcher.matches(null)).isFalse(); 23 | } 24 | 25 | @Test 26 | public void whitespaceDifference() throws Exception { 27 | assertThat(matcher.matches("1.0.0 ")).isFalse(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /licenses-generator/src/test/java/org/jboss/pnc/bacon/licenses/sanitiser/exceptions/RegexpVersionMatcherTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.licenses.sanitiser.exceptions; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class RegexpVersionMatcherTest { 8 | private VersionMatcher matcher = new RegexpVersionMatcher("1.0.0(-redhat-\\d+)?"); 9 | 10 | @Test 11 | public void matchingString() throws Exception { 12 | assertThat(matcher.matches("1.0.0")).isTrue(); 13 | assertThat(matcher.matches("1.0.0-redhat-1")).isTrue(); 14 | assertThat(matcher.matches("1.0.0-redhat-999")).isTrue(); 15 | } 16 | 17 | @Test 18 | public void nonmatchingString() throws Exception { 19 | assertThat(matcher.matches("2.0.0")).isFalse(); 20 | } 21 | 22 | @Test 23 | public void nullString() throws Exception { 24 | assertThat(matcher.matches(null)).isFalse(); 25 | } 26 | 27 | @Test 28 | public void whitespaceDifference() throws Exception { 29 | assertThat(matcher.matches("1.0.0 ")).isFalse(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /licenses-generator/src/test/resources/rh-license-names.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Test License Name", 4 | "url": "http://test-license.com", 5 | "aliases": [ 6 | "Test License Alias" 7 | ], 8 | "urlAliases": [ 9 | "http://test-license-alias.com" 10 | ] 11 | }, 12 | { 13 | "name": "Test License Name 2", 14 | "url": "http://test-license-2.com", 15 | "aliases": [ 16 | "Test License Alias 2" 17 | ], 18 | "urlAliases": [ 19 | "http://test-license-alias-2.com" 20 | ] 21 | }, 22 | { 23 | "name": "Test License Name 3", 24 | "url": "http://test-license-3.com/licens.html", 25 | "textUrl": "http://internal-host/license3.txt", 26 | "aliases": [ 27 | "Test License Name 3" 28 | ], 29 | "urlAliases": [ 30 | "http://test-license-3.com/licens.html" 31 | ] 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /licenses-generator/src/test/resources/test-pom-with-exceptions.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | test 7 | test 8 | 1.0 9 | 10 | 11 | 12 | 13 | junit 14 | junit 15 | 4.12 16 | 17 | 18 | org.apache.tomcat 19 | servlet-api 20 | 6.0.41 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /licenses-generator/src/test/resources/test-pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | test 7 | test 8 | 1.0 9 | 10 | 11 | 12 | junit 13 | junit 14 | 4.12 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /licenses-generator/src/test/resources/test_properties/empty.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/licenses-generator/src/test/resources/test_properties/empty.properties -------------------------------------------------------------------------------- /licenses-generator/src/test/resources/test_properties/modified.properties: -------------------------------------------------------------------------------- 1 | repository.names=testRepositoryName1,testRepositoryName2 2 | repository.urls=testRepositoryUrl1,testRepositoryUrl2 3 | licenseServiceUrl=http://10.10.10.10/find-license-check-record 4 | -------------------------------------------------------------------------------- /licenses-generator/src/test/resources/test_properties/wrong-repositories.properties: -------------------------------------------------------------------------------- 1 | repository.urls=testRepositoryUrl1,testRepositoryUrl2 2 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/MisconfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl; 19 | 20 | /** 21 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
22 | * Date: 4/2/19 23 | */ 24 | public class MisconfigurationException extends RuntimeException { 25 | 26 | public MisconfigurationException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/cachi2/YamlUtil.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.cachi2; 2 | 3 | import com.fasterxml.jackson.databind.DeserializationFeature; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 6 | import com.fasterxml.jackson.databind.SerializationFeature; 7 | import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; 8 | 9 | class YamlUtil { 10 | 11 | static ObjectMapper initYamlMapper() { 12 | return new ObjectMapper(new YAMLFactory()).enable(SerializationFeature.INDENT_OUTPUT) 13 | .enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS) 14 | .setPropertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE) 15 | .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/quarkus/ByExtensionCollectingVisitor.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.quarkus; 2 | 3 | import java.nio.file.FileVisitResult; 4 | import java.nio.file.Files; 5 | import java.nio.file.Path; 6 | import java.nio.file.SimpleFileVisitor; 7 | import java.nio.file.attribute.BasicFileAttributes; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
13 | * Date: 13/08/2019 14 | */ 15 | public class ByExtensionCollectingVisitor extends SimpleFileVisitor { 16 | private final List filePaths = new ArrayList<>(); 17 | private final String extension; 18 | 19 | public ByExtensionCollectingVisitor(String extension) { 20 | this.extension = extension; 21 | } 22 | 23 | @Override 24 | public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { 25 | if (Files.isRegularFile(file) && file.toString().endsWith(extension)) { 26 | filePaths.add(file.toAbsolutePath()); 27 | } 28 | return FileVisitResult.CONTINUE; 29 | } 30 | 31 | public List getFilePaths() { 32 | return filePaths; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/quarkus/QuarkusCommunityDependency.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.quarkus; 2 | 3 | import java.util.Collection; 4 | import java.util.stream.Collectors; 5 | 6 | import org.jboss.pnc.bacon.pig.impl.documents.sharedcontent.da.CommunityDependency; 7 | import org.jboss.pnc.bacon.pig.impl.documents.sharedcontent.da.CsvExportable; 8 | import org.jboss.pnc.bacon.pig.impl.utils.GAV; 9 | 10 | public class QuarkusCommunityDependency implements CsvExportable { 11 | 12 | private final String usingExtensions; 13 | private final CommunityDependency communityDependency; 14 | 15 | public QuarkusCommunityDependency(Collection usingExtensions, CommunityDependency communityDependency) { 16 | this.usingExtensions = usingExtensions.stream().map(gav -> { 17 | if (gav.getGroupId().equals("io.quarkus")) { 18 | return gav.getArtifactId(); 19 | } else { 20 | return String.format("%s:%s", gav.getGroupId(), gav.getArtifactId()); 21 | } 22 | }).collect(Collectors.joining(",")); 23 | this.communityDependency = communityDependency; 24 | } 25 | 26 | @Override 27 | public String toCsvLine() { 28 | return String.format("%s;%s", communityDependency.toCsvLine(), usingExtensions); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/quarkus/QuarkusExtension.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.quarkus; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
9 | * Date: 19/08/2019 10 | */ 11 | @Data 12 | public class QuarkusExtension { 13 | @JsonProperty("artifact") 14 | private String artifact; 15 | } 16 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/quarkus/QuarkusExtensions.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.quarkus; 2 | 3 | import java.util.List; 4 | 5 | import lombok.Data; 6 | 7 | /** 8 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
9 | * Date: 1/23/20 10 | */ 11 | @Data 12 | public class QuarkusExtensions { 13 | private List extensions; 14 | } 15 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/scanservice/pssaas/AddAuthHeadersRequestFilter.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.scanservice.pssaas; 2 | 3 | import java.io.IOException; 4 | import java.util.Map; 5 | import java.util.TreeMap; 6 | 7 | import javax.ws.rs.client.ClientRequestContext; 8 | import javax.ws.rs.client.ClientRequestFilter; 9 | 10 | public class AddAuthHeadersRequestFilter implements ClientRequestFilter { 11 | private Map headers = new TreeMap(); 12 | 13 | public AddAuthHeadersRequestFilter(Map headers) { 14 | this.headers = headers; 15 | } 16 | 17 | public void addAuthHeader(String key, String value) { 18 | this.headers.put(key, value); 19 | } 20 | 21 | @Override 22 | public void filter(ClientRequestContext requestContext) throws IOException { 23 | for (Map.Entry entry : this.headers.entrySet()) { 24 | requestContext.getHeaders().add(entry.getKey(), entry.getValue()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/scanservice/pssaas/ScanHelper.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.scanservice.pssaas; 2 | 3 | import java.net.URI; 4 | import java.util.Map; 5 | import java.util.TreeMap; 6 | 7 | import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; 8 | 9 | public class ScanHelper { 10 | 11 | public ScanInterface client; 12 | private static Map authHeaders = new TreeMap(); 13 | 14 | public ScanHelper(String pssaasSecretKey, String pssaasSecretValue, URI target) { 15 | authHeaders.put("PSSC-Secret-Key", pssaasSecretKey); 16 | authHeaders.put("PSSC-Secret-Value", pssaasSecretValue); 17 | client = new ResteasyClientBuilder().build() 18 | .target(target) 19 | .register(new AddAuthHeadersRequestFilter(authHeaders)) 20 | .register(new RedirectAndLog()) 21 | .proxy(ScanInterface.class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/addons/scanservice/pssaas/ScanInterface.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.scanservice.pssaas; 2 | 3 | import javax.ws.rs.*; 4 | import javax.ws.rs.core.MediaType; 5 | import javax.ws.rs.core.Response; 6 | 7 | import org.jboss.pnc.bacon.pig.impl.addons.scanservice.ScanServiceDTO; 8 | 9 | public interface ScanInterface { 10 | 11 | @POST 12 | @Path("/") 13 | @Consumes({ MediaType.APPLICATION_JSON }) 14 | Response triggerScan(ScanServiceDTO builds); 15 | } 16 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/AdditionalArtifactsFromBuild.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | import java.util.List; 21 | 22 | import lombok.Data; 23 | 24 | /** 25 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
26 | * Date: 2/5/18 27 | */ 28 | @Data 29 | public class AdditionalArtifactsFromBuild { 30 | private String from; 31 | private List download; 32 | } 33 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.config; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Annotation which groups fields that relay the same value 10 | */ 11 | @Target(ElementType.FIELD) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface FieldGroup { 14 | /** 15 | * represents group identifier 16 | * 17 | * f.e. "environment" identifier represents all fields that can by themself represent an environment 18 | */ 19 | String value(); 20 | } 21 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/GenerationData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | import lombok.Data; 21 | 22 | /** 23 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
24 | * Date: 1/17/18 25 | */ 26 | @Data 27 | public abstract class GenerationData { 28 | private GenerationStrategyType strategy; 29 | private String sourceBuild; 30 | private String sourceArtifact; 31 | } 32 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/GroupBuildInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | import java.util.Map; 21 | 22 | import org.jboss.pnc.bacon.pig.impl.pnc.PncBuild; 23 | import org.jboss.pnc.dto.GroupBuild; 24 | 25 | import lombok.AllArgsConstructor; 26 | import lombok.Data; 27 | 28 | @Data 29 | @AllArgsConstructor 30 | public class GroupBuildInfo { 31 | private GroupBuild groupBuild; 32 | private Map builds; 33 | } 34 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/JavadocGenerationStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | /** 21 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
22 | * Date: 5/23/18 23 | */ 24 | public enum JavadocGenerationStrategy { 25 | DOWNLOAD, GENERATE, IGNORE 26 | } 27 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/LicenseGenerationData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | import com.fasterxml.jackson.annotation.JsonInclude; 21 | 22 | import lombok.Data; 23 | 24 | /** 25 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
26 | * Date: 5/25/18 27 | */ 28 | @Data 29 | @JsonInclude(JsonInclude.Include.NON_NULL) 30 | public class LicenseGenerationData extends GenerationData { 31 | 32 | private String licenseExceptionsPath; 33 | 34 | private String licenseNamesPath; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/LicenseGenerationStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | /** 21 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
22 | * Date: 5/23/18 23 | */ 24 | public enum LicenseGenerationStrategy { 25 | GENERATE, IGNORE, DOWNLOAD 26 | } 27 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/Output.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | import javax.validation.constraints.NotBlank; 21 | 22 | import lombok.Data; 23 | 24 | /** 25 | * 26 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
27 | * Date: 11/28/17 28 | */ 29 | @Data 30 | public class Output { 31 | 32 | private @NotBlank String releaseFile; 33 | private @NotBlank String releaseDir; 34 | } 35 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/config/RepoGenerationStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.config; 19 | 20 | /** 21 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
22 | * Date: 5/23/18 23 | */ 24 | public enum RepoGenerationStrategy { 25 | BOM, RESOLVE_ONLY, GENERATE, DOWNLOAD, BUILD_CONFIGS, BUILD_GROUP, MILESTONE, OFFLINER_ONLY, IGNORE, PACK_ALL // DEPRECATED 26 | // replaced 27 | // by 28 | // BUILD_CONFIGS 29 | } 30 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/documents/DataRoot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.jboss.pnc.bacon.pig.impl.documents; 20 | 21 | import java.util.Collection; 22 | 23 | import org.jboss.pnc.bacon.pig.impl.config.PigConfiguration; 24 | import org.jboss.pnc.bacon.pig.impl.pnc.PncBuild; 25 | 26 | import lombok.AllArgsConstructor; 27 | import lombok.Data; 28 | import lombok.NoArgsConstructor; 29 | 30 | /** 31 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
32 | * Date: 6/5/17 33 | */ 34 | @Data 35 | @AllArgsConstructor 36 | @NoArgsConstructor 37 | public class DataRoot { 38 | private PigConfiguration pigConfiguration; 39 | private Deliverables deliverables; 40 | private String duplicates; 41 | private String repositoryContents; 42 | private Collection builds; 43 | private String pncUrl; 44 | } 45 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/documents/sharedcontent/da/CsvExportable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.documents.sharedcontent.da; 19 | 20 | import java.io.FileWriter; 21 | import java.io.IOException; 22 | 23 | /** 24 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
25 | * Date: 13/08/2019 26 | */ 27 | public interface CsvExportable { 28 | String toCsvLine(); 29 | 30 | default void appendToCsv(FileWriter writer) { 31 | try { 32 | writer.append(toCsvLine()).append("\n"); 33 | } catch (IOException e) { 34 | throw new IllegalStateException("Cannot write to the output file", e); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/documents/sharedcontent/da/DependencyState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.jboss.pnc.bacon.pig.impl.documents.sharedcontent.da; 20 | 21 | /** 22 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
23 | * Date: 6/2/17 24 | */ 25 | public enum DependencyState { 26 | MATCH_FOUND, REVERSION_POSSIBLE, NO_MATCH 27 | } 28 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/documents/sharedcontent/da/ThorntailCommunityDependency.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.documents.sharedcontent.da; 2 | 3 | import java.util.List; 4 | 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | import lombok.ToString; 8 | 9 | /** 10 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
11 | * Date: 13/08/2019 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | public class ThorntailCommunityDependency implements CsvExportable { 17 | 18 | private final CommunityDependency communityDependency; 19 | private List usedForThorntail; 20 | 21 | public ThorntailCommunityDependency(CommunityDependency communityDependency, List usedForThorntail) { 22 | this.communityDependency = communityDependency; 23 | this.usedForThorntail = usedForThorntail; 24 | } 25 | 26 | public String toCsvLine() { 27 | return String.format("%s; %s", communityDependency.toCsvLine(), usedForThorntail); 28 | } 29 | 30 | public List getUsedForThorntail() { 31 | return usedForThorntail; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/out/PigBuildOutput.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.out; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PigBuildOutput { 7 | private String message; 8 | private PigRunOutput pigRunOutput; 9 | 10 | public PigBuildOutput(String message, PigRunOutput pigRunOutput) { 11 | this.message = message; 12 | this.pigRunOutput = pigRunOutput; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/out/PigReleaseOutput.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.out; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PigReleaseOutput { 7 | private String releaseDirName; 8 | private String releasePath; 9 | private String nvrListFile; 10 | 11 | public PigReleaseOutput(String releaseDirName, String releasePath, String nvrListFile) { 12 | this.releaseDirName = releaseDirName; 13 | this.releasePath = releasePath; 14 | this.nvrListFile = nvrListFile; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/pnc/ImportResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.pnc; 19 | 20 | import java.util.List; 21 | 22 | import org.jboss.pnc.dto.GroupConfigurationRef; 23 | import org.jboss.pnc.dto.ProductMilestoneRef; 24 | import org.jboss.pnc.dto.ProductVersionRef; 25 | 26 | import lombok.AllArgsConstructor; 27 | import lombok.Data; 28 | 29 | /** 30 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
31 | * Date: 12/4/17 32 | */ 33 | @Data 34 | @AllArgsConstructor 35 | public class ImportResult { 36 | private ProductMilestoneRef milestone; 37 | private GroupConfigurationRef buildGroup; 38 | private ProductVersionRef version; 39 | private List buildConfigs; 40 | 41 | @Deprecated // for jackson only 42 | public ImportResult() { 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/pnc/NoSuccessfulBuildException.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.pnc; 2 | 3 | public class NoSuccessfulBuildException extends RuntimeException { 4 | public NoSuccessfulBuildException(String buildConfigId) { 5 | super("Unable to find a successful build of build config '" + buildConfigId + "'"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/repo/RepositoryData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.repo; 19 | 20 | import java.io.File; 21 | import java.nio.file.Path; 22 | import java.util.Collection; 23 | 24 | import org.jboss.pnc.bacon.pig.impl.utils.GAV; 25 | 26 | import lombok.Data; 27 | 28 | /** 29 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
30 | * Date: 8/29/17 31 | */ 32 | @Data 33 | public class RepositoryData { 34 | private Collection gavs; 35 | private Collection files; 36 | private Path repositoryPath; 37 | } 38 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/repo/Sl4jMessageWriter.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.repo; 2 | 3 | import org.slf4j.Logger; 4 | 5 | import io.quarkus.devtools.messagewriter.MessageWriter; 6 | 7 | class Sl4jMessageWriter implements MessageWriter { 8 | 9 | private final Logger log; 10 | 11 | Sl4jMessageWriter(Logger log) { 12 | this.log = log; 13 | } 14 | 15 | @Override 16 | public void info(String s) { 17 | log.info(s); 18 | } 19 | 20 | @Override 21 | public void error(String s) { 22 | log.error(s); 23 | } 24 | 25 | @Override 26 | public boolean isDebugEnabled() { 27 | return log.isDebugEnabled(); 28 | } 29 | 30 | @Override 31 | public void debug(String s) { 32 | log.debug(s); 33 | } 34 | 35 | @Override 36 | public void warn(String s) { 37 | log.warn(s); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/repo/visitor/ArtifactVisit.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.repo.visitor; 2 | 3 | import java.util.Map; 4 | 5 | import org.jboss.pnc.bacon.pig.impl.utils.GAV; 6 | 7 | /** 8 | * Information about a visited artifact 9 | */ 10 | public interface ArtifactVisit { 11 | 12 | GAV getGav(); 13 | 14 | Map getChecksums(); 15 | } 16 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/repo/visitor/ArtifactVisitor.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.repo.visitor; 2 | 3 | /** 4 | * Repository artifact visitor 5 | */ 6 | public interface ArtifactVisitor { 7 | 8 | /** 9 | * Called for each artifact present in a repository 10 | * 11 | * @param visit visited artifact 12 | */ 13 | void visit(ArtifactVisit visit); 14 | } 15 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/repo/visitor/VisitableArtifactRepository.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.repo.visitor; 2 | 3 | import java.nio.file.Path; 4 | 5 | /** 6 | * Visitable Maven artifact repository 7 | */ 8 | public interface VisitableArtifactRepository { 9 | 10 | static VisitableArtifactRepository of(Path mavenRepo) { 11 | return new FileSystemArtifactRepository(mavenRepo); 12 | } 13 | 14 | /** 15 | * Visits artifacts present in the repository 16 | * 17 | * @param visitor artifact visitor 18 | */ 19 | void visit(ArtifactVisitor visitor); 20 | 21 | /** 22 | * Total number of artifacts found in this repository. 23 | * 24 | * @return total number of artifacts found in this repository 25 | */ 26 | int getArtifactsTotal(); 27 | } 28 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/sources/SourcesGenerationData.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.sources; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.jboss.pnc.bacon.pig.impl.config.GenerationData; 7 | 8 | import lombok.Data; 9 | 10 | @Data 11 | public class SourcesGenerationData extends GenerationData { 12 | 13 | /** 14 | * Each entry can be a part of an artifact If none are supplied, then it's assumed that sources from all artifacts 15 | * are to be added 16 | */ 17 | private List whitelistedArtifacts; 18 | 19 | private List additionalExternalSources; 20 | 21 | private List excludeSourceBuilds; 22 | 23 | private boolean oldBCNaming = false; 24 | 25 | /** 26 | * Add defaults to avoid having existing configurations having to define a sourceGeneration object in the flow 27 | * section 28 | */ 29 | public SourcesGenerationData() { 30 | this.whitelistedArtifacts = new ArrayList<>(); 31 | this.additionalExternalSources = new ArrayList<>(); 32 | this.excludeSourceBuilds = new ArrayList<>(); 33 | setStrategy(SourcesGenerationStrategy.GENERATE); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/sources/SourcesGenerationStrategy.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.sources; 2 | 3 | public enum SourcesGenerationStrategy { 4 | IGNORE, 5 | GENERATE, 6 | GENERATE_EXTENDED, 7 | GENERATE_ADDITIONAL_SELECTED, 8 | GENERATE_SELECTED, 9 | GENERATE_REDHAT_DEPENDENCIES, 10 | GENERATE_REDHAT_DEPENDENCIES_EXTENDED 11 | } 12 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/AlignmentType.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils; 2 | 3 | public enum AlignmentType { 4 | TEMPORARY, PERSISTENT 5 | } 6 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/CSVUtils.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils; 2 | 3 | import java.io.IOException; 4 | import java.io.Reader; 5 | import java.nio.charset.StandardCharsets; 6 | import java.nio.file.Files; 7 | import java.nio.file.Paths; 8 | import java.util.Set; 9 | import java.util.stream.Collectors; 10 | 11 | import org.apache.commons.csv.CSVFormat; 12 | import org.apache.commons.csv.CSVParser; 13 | 14 | /** 15 | * @author Harsh Madhani Date: 06-August-2020 16 | */ 17 | public class CSVUtils { 18 | public static Set columnValues(String columnName, String filePath, char delimiter) throws IOException { 19 | try (Reader in = Files.newBufferedReader(Paths.get(filePath), StandardCharsets.UTF_8); 20 | CSVParser parser = CSVFormat.EXCEL.withDelimiter(delimiter).withFirstRecordAsHeader().parse(in)) { 21 | return parser.getRecords().stream().map(record -> record.get(columnName)).collect(Collectors.toSet()); 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/CollectionUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.jboss.pnc.bacon.pig.impl.utils; 20 | 21 | import java.util.HashSet; 22 | import java.util.Set; 23 | 24 | /** 25 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
26 | * Date: 7/7/17 27 | */ 28 | public class CollectionUtils { 29 | 30 | private CollectionUtils() { 31 | } 32 | 33 | public static Set subtractSet(Set minuend, Set subtrahend) { 34 | Set resultSet = new HashSet<>(minuend); 35 | resultSet.removeAll(subtrahend); 36 | return resultSet; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/OSCommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.utils; 19 | 20 | /** 21 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
22 | * Date: 11/20/17 23 | */ 24 | public class OSCommandException extends RuntimeException { 25 | private static final long serialVersionUID = 1L; 26 | 27 | public OSCommandException(String message) { 28 | super(message); 29 | } 30 | 31 | public OSCommandException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/PropertyUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2017 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pig.impl.utils; 19 | 20 | import java.util.Map; 21 | import java.util.Properties; 22 | import java.util.regex.Pattern; 23 | 24 | /** 25 | * @author Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com
26 | * Date: 9/29/17 27 | */ 28 | public class PropertyUtils { 29 | public static String replaceProperties(String text, Properties properties) { 30 | for (Map.Entry property : properties.entrySet()) { 31 | String key = String.format("${%s}", property.getKey()); 32 | key = Pattern.quote(key); 33 | text = text.replaceAll(key, String.valueOf(property.getValue())); 34 | } 35 | return text; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/pom/DependencyManagement.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils.pom; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.xml.bind.annotation.XmlElement; 7 | import javax.xml.bind.annotation.XmlElementWrapper; 8 | 9 | /** 10 | * @author Paul Gallagher, pgallagh@redhat
11 | * Date: 12/10/2018 12 | */ 13 | public class DependencyManagement { 14 | List dependencies = new ArrayList<>(); 15 | 16 | @XmlElementWrapper 17 | @XmlElement(name = "dependency") 18 | public List getDependencies() { 19 | return dependencies; 20 | } 21 | 22 | public void addDependency(Dependency dependency) { 23 | dependencies.add(dependency); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/pom/Profile.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils.pom; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.xml.bind.annotation.XmlElement; 7 | import javax.xml.bind.annotation.XmlElementWrapper; 8 | 9 | /** 10 | * @author Paul Gallagher, pgallagh@redhat
11 | * Date: 12/10/2018 12 | */ 13 | public class Profile { 14 | List dependencies = new ArrayList<>(); 15 | DependencyManagement dependencyManagement = new DependencyManagement(); 16 | String id; 17 | 18 | @XmlElementWrapper 19 | @XmlElement(name = "dependency") 20 | public List getDependencies() { 21 | return dependencies; 22 | } 23 | 24 | public void addDependency(Dependency dep) { 25 | dependencies.add(dep); 26 | } 27 | 28 | public String getId() { 29 | return id; 30 | } 31 | 32 | @XmlElement 33 | public void setId(String id) { 34 | this.id = id; 35 | } 36 | 37 | @XmlElement 38 | public DependencyManagement getDependencyManagement() { 39 | return dependencyManagement; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/pom/Profiles.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils.pom; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.xml.bind.annotation.XmlElement; 7 | 8 | /** 9 | * @author Paul Gallagher, pgallagh@redhat
10 | * Date: 12/10/2018 11 | */ 12 | public class Profiles { 13 | List profile = new ArrayList<>(); 14 | 15 | @XmlElement 16 | public List getProfile() { 17 | return profile; 18 | } 19 | 20 | public void addProfile(Profile profile) { 21 | this.profile.add(profile); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/utils/pom/Project.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils.pom; 2 | 3 | import javax.xml.bind.annotation.XmlElement; 4 | import javax.xml.bind.annotation.XmlRootElement; 5 | 6 | /** 7 | * @author Paul Gallagher, pgallagh@redhat
8 | * Date: 12/10/2018 9 | */ 10 | @XmlRootElement 11 | public class Project { 12 | @XmlElement 13 | String modelVersion = "4.0.0"; 14 | @XmlElement 15 | String packaging = "pom"; 16 | 17 | String groupId; 18 | String artifactId; 19 | String version; 20 | 21 | @XmlElement 22 | Profiles profiles = new Profiles(); 23 | 24 | public String getGroupId() { 25 | return groupId; 26 | } 27 | 28 | @XmlElement 29 | public void setGroupId(String groupId) { 30 | this.groupId = groupId; 31 | } 32 | 33 | public String getArtifactId() { 34 | return artifactId; 35 | } 36 | 37 | @XmlElement 38 | public void setArtifactId(String artifactId) { 39 | this.artifactId = artifactId; 40 | } 41 | 42 | public String getVersion() { 43 | return version; 44 | } 45 | 46 | @XmlElement 47 | public void setVersion(String version) { 48 | this.version = version; 49 | } 50 | 51 | public Profiles getProfiles() { 52 | return profiles; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/validation/GenerationDataCheck.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.validation; 2 | 3 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 4 | import static java.lang.annotation.ElementType.FIELD; 5 | import static java.lang.annotation.ElementType.METHOD; 6 | import static java.lang.annotation.ElementType.PARAMETER; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.Target; 11 | 12 | import javax.validation.Constraint; 13 | import javax.validation.Payload; 14 | 15 | /** 16 | * Validator annotation for GenerationData 17 | */ 18 | @Target({ FIELD, METHOD, PARAMETER, ANNOTATION_TYPE }) 19 | @Retention(RUNTIME) 20 | @Constraint(validatedBy = GenerationDataValidator.class) 21 | public @interface GenerationDataCheck { 22 | 23 | String message() default "Generation Data validation fail"; 24 | 25 | Class[] groups() default {}; 26 | 27 | Class[] payload() default {}; 28 | } 29 | -------------------------------------------------------------------------------- /pig/src/main/java/org/jboss/pnc/bacon/pig/impl/validation/ListBuildConfigCheck.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.validation; 2 | 3 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE; 4 | import static java.lang.annotation.ElementType.FIELD; 5 | import static java.lang.annotation.ElementType.METHOD; 6 | import static java.lang.annotation.ElementType.PARAMETER; 7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 8 | 9 | import java.lang.annotation.Retention; 10 | import java.lang.annotation.Target; 11 | 12 | import javax.validation.Constraint; 13 | import javax.validation.Payload; 14 | 15 | /** 16 | * Validator annotation for Build config 17 | */ 18 | @Target({ FIELD, METHOD, PARAMETER, ANNOTATION_TYPE }) 19 | @Retention(RUNTIME) 20 | @Constraint(validatedBy = ListBuildConfigValidator.class) 21 | public @interface ListBuildConfigCheck { 22 | 23 | String message() default "Build Config validation fail"; 24 | 25 | Class[] groups() default {}; 26 | 27 | Class[] payload() default {}; 28 | } 29 | -------------------------------------------------------------------------------- /pig/src/main/resources/ARTIFACT_LIST.ftl: -------------------------------------------------------------------------------- 1 | ${repositoryContents} 2 | -------------------------------------------------------------------------------- /pig/src/main/resources/BUILD_LIST.ftl: -------------------------------------------------------------------------------- 1 | [ 2 | <#list builds as build> 3 | { 4 | "id":"${build.id}", 5 | "name":"${build.name}", 6 | "url":"${pncUrl}/pnc-web/#/builds/${build.id}", 7 | "internalScmUrl":"${build.internalScmUrl}", 8 | "scmRevision":"${build.scmRevision}", 9 | "scmTag":"${build.scmTag}" 10 | }<#sep>, 11 | 12 | ] 13 | -------------------------------------------------------------------------------- /pig/src/main/resources/DUPLICATE_ARTIFACT_LIST.ftl: -------------------------------------------------------------------------------- 1 | ${duplicates} 2 | -------------------------------------------------------------------------------- /pig/src/main/resources/REPOSITORY_CONTENTS.ftl: -------------------------------------------------------------------------------- 1 | ${repositoryContents} 2 | -------------------------------------------------------------------------------- /pig/src/main/resources/REPOSITORY_COORDINATES.ftl: -------------------------------------------------------------------------------- 1 | <#list builds as build> 2 | ${build.name}_SCM_URL=${build.internalScmUrl} 3 | ${build.name}_SCM_REVISION=${build.scmRevision} 4 | 5 | -------------------------------------------------------------------------------- /pig/src/main/resources/koji-build-finder/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "archive-extensions" : [ "dll", "dylib", "ear", "jar", "jdocbook", "jdocbook-style", "kar", "plugin", "pom", "rar", "sar", "so", "war", "xml" ], 3 | "archive-types" : [ "jar", "xml", "pom", "so", "dll", "dylib" ], 4 | "build-systems" : [ "koji" ], 5 | "checksum-only" : false, 6 | "checksum-type" : "md5", 7 | "excludes" : [ "^(?!.*/pom\\.xml$).*/.*\\.xml$" ], 8 | "koji-hub-url" : "${KOJI_URL}/brewhub", 9 | "koji-web-url" : "${KOJI_URL}/brew" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /pig/src/main/resources/license-generator.properties: -------------------------------------------------------------------------------- 1 | # to run with PNC stage, you need to set the `INDY_REPO_URL` environment variable to http://indy-stage.psi.redhat.com/ 2 | repository.names=${names} 3 | repository.urls=${urls} 4 | ${licenseServiceUrl} 5 | -------------------------------------------------------------------------------- /pig/src/main/resources/repository-README.md: -------------------------------------------------------------------------------- 1 | ${PRODUCT_NAME} Maven Repository 2 | ======================= 3 | 4 | This archive contains Maven repository artifacts for ${PRODUCT_NAME}. 5 | -------------------------------------------------------------------------------- /pig/src/main/resources/uploadToCandidates.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | 3 | set timeout 1800 4 | spawn ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $::env(LOGIN)@rcm-guest.app.eng.bos.redhat.com 5 | expect { 6 | password { send "$::env(PASSWORD)\r" ; exp_continue } 7 | bash { send "kinit\r" } 8 | } 9 | expect Password { send "$::env(PASSWORD)\r" } 10 | expect bash { send "/mnt/redhat/scripts/rel-eng/utility/bus-clients/stage-mw-release ${productWithVersion}\r" } 11 | expect bash 12 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/PigContextTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import java.nio.file.Path; 6 | import java.nio.file.Paths; 7 | 8 | import org.junit.jupiter.api.Test; 9 | 10 | class PigContextTest { 11 | 12 | @Test 13 | void testPrefixGeneration() { 14 | Path resourcesFolderPath = Paths.get("src", "test", "resources"); 15 | PigContext pigContext = new PigContext(); 16 | pigContext.initConfig(resourcesFolderPath, "targetPath", null, null); 17 | pigContext.initFullVersion(false); 18 | pigContext.configureTargetDirectories(); 19 | assertTrue( 20 | pigContext.getPrefix() 21 | .startsWith(pigContext.getPigConfiguration().getOutputPrefixes().getReleaseFile())); 22 | assertTrue(pigContext.getPrefix().endsWith(pigContext.getPigConfiguration().getOutputSuffix())); 23 | assertTrue(pigContext.getPrefix().contains(pigContext.getPigConfiguration().getVersion())); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/addons/camel/TreeNodeTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.camel; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class TreeNodeTest { 11 | @Test 12 | public void testTreeNodes() { 13 | TreeNode tn = new TreeNode("foo"); 14 | TreeNode bar = new TreeNode("bar"); 15 | TreeNode foobar = new TreeNode("foobar"); 16 | TreeNode secondLevel = new TreeNode("secondlevel"); 17 | 18 | bar.addChild(secondLevel); 19 | 20 | tn.addChild(bar); 21 | tn.addChild(foobar); 22 | 23 | assertTrue(tn.getChildren().size() == 2); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/addons/vertx/NotYetAlignedFromDependencyTreeTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.addons.vertx; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | class NotYetAlignedFromDependencyTreeTest { 8 | 9 | @Test 10 | void testMatchingDependencyLine() { 11 | // repeated INFO line 12 | String line = "[INFO] [INFO] +- org.apache.kafka:connect-api:jar:3.6.1:compile"; 13 | // whitespace at the beginning and end 14 | String line2 = " [INFO] +- org.apache.kafka:connect-api:jar:3.6.1:runtime "; 15 | // shouldn't match that one since not top-level 16 | String nonMatchingLine = "[INFO] | | \\- com.fasterxml.jackson.core:jackson-core:jar:2.16.1.redhat-00003:compile"; 17 | // shouldn't match since it is of type provided 18 | String nonMatchingLine2 = "[INFO] +- org.projectlombok:lombok:jar:1.18.32:provided"; 19 | 20 | assertTrue(NotYetAlignedFromDependencyTree.matchingDependencyLine(line)); 21 | assertTrue(NotYetAlignedFromDependencyTree.matchingDependencyLine(line2)); 22 | assertFalse(NotYetAlignedFromDependencyTree.matchingDependencyLine(nonMatchingLine)); 23 | assertFalse(NotYetAlignedFromDependencyTree.matchingDependencyLine(nonMatchingLine2)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/repo/BomMultiStepRepositoryStrategyTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.repo; 2 | 3 | import org.jboss.pnc.bacon.pig.impl.config.RepoGenerationStrategy; 4 | 5 | public class BomMultiStepRepositoryStrategyTest extends MultiStepBomBasedRepositoryTestBase { 6 | 7 | @Override 8 | protected void assertOutcome() { 9 | assertCachi2LockFile(CACHI2_LOCKFILE_NAME); 10 | } 11 | 12 | @Override 13 | protected RepoGenerationStrategy getRepoGenerationStrategy() { 14 | return RepoGenerationStrategy.BOM; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/repo/ResolveOnlyStepsRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.repo; 2 | 3 | import org.jboss.pnc.bacon.pig.impl.config.RepoGenerationStrategy; 4 | 5 | public class ResolveOnlyStepsRepositoryTest extends MultiStepBomBasedRepositoryTestBase { 6 | 7 | @Override 8 | protected RepoGenerationStrategy getRepoGenerationStrategy() { 9 | return RepoGenerationStrategy.RESOLVE_ONLY; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/utils/BuildFinderUtilsTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import java.io.File; 6 | 7 | import org.jboss.pnc.bacon.config.Config; 8 | import org.jboss.pnc.build.finder.core.BuildConfig; 9 | import org.junit.jupiter.api.Test; 10 | 11 | class BuildFinderUtilsTest { 12 | @Test 13 | void getKojiBuildFinderConfig() { 14 | File configFile = new File( 15 | new File(BuildFinderUtilsTest.class.getResource("/").getFile()).getParentFile() 16 | .getParentFile() 17 | .getParentFile(), 18 | "config.yaml"); 19 | Config.configure(configFile.getParent(), configFile.getName(), "default"); 20 | Config.instance().getActiveProfile().getPig().setKojiHubUrl("https://127.0.0.1"); 21 | 22 | BuildConfig bc = BuildFinderUtils.getKojiBuildFinderConfig(); 23 | assertTrue(bc.getKojiHubURL().toString().contains("127.0.0.1")); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /pig/src/test/java/org/jboss/pnc/bacon/pig/impl/utils/indy/IndyTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pig.impl.utils.indy; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import java.io.File; 6 | import java.io.IOException; 7 | 8 | import org.jboss.pnc.bacon.config.Config; 9 | import org.junit.jupiter.api.BeforeAll; 10 | import org.junit.jupiter.api.Test; 11 | 12 | class IndyTest { 13 | 14 | @BeforeAll 15 | static void setup() throws IOException { 16 | File file = new File(IndyTest.class.getClassLoader().getResource("config.yaml").getFile()); 17 | Config.configure(file.getParent(), "config.yaml", "default"); 18 | Config.initialize(); 19 | } 20 | 21 | @Test 22 | void getIndyUrl() { 23 | assertNotNull(Indy.getIndyUrl()); 24 | assertTrue(Indy.getIndyUrl().contains("http://indy.com/api/content/maven/group/static")); 25 | } 26 | 27 | @Test 28 | void getIndyTempUrl() { 29 | assertNotNull(Indy.getIndyTempUrl()); 30 | assertTrue(Indy.getIndyTempUrl().contains("http://indy.com/api/content/maven/hosted/temporary-builds")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/build-stub.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Builds list 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
quarkus-1.0.1/
quarkus-1.0.0/
16 | 17 | 18 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/community-deps1.csv: -------------------------------------------------------------------------------- 1 | Community dependencies;;Productized counterpart;Other productized versions;Additional info 2 | com.google.code.findbugs:jsr305:3.0.2;REVERSION_POSSIBLE;null;2.0.1 3 | io.netty:netty-transport-native-unix-common:4.1.49.Final;MATCH_FOUND;4.1.49.Final;4.1.49.Final 4 | com.google.api.grpc:proto-google-common-protos:1.17.0;NO_MATCH;null;None 5 | com.google.j2objc:j2objc-annotations:1.1;MATCH_FOUND;1.1.0;1.1.0,0.9.8 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/community-deps2.csv: -------------------------------------------------------------------------------- 1 | Community dependencies;;Productized counterpart;Other productized versions;Additional info 2 | com.google.code.findbugs:jsr305:3.0.2; REVERSION_POSSIBLE; null; 2.0.1 3 | org.codehaus.mojo:animal-sniffer-annotations:1.18; REVERSION_POSSIBLE; null; 1.17.0,1.14.0 4 | com.google.api.grpc:proto-google-common-protos:1.17.0; NO_MATCH; null; None 5 | com.google.j2objc:j2objc-annotations:1.1; MATCH_FOUND; 1.1.0; 1.1.0,0.9.8 6 | com.google.android:annotations:4.1.1.4; NO_MATCH; null; None 7 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/expectedPostBuildInfo.txt: -------------------------------------------------------------------------------- 1 | Community Dependencies present in new build which were not present in old build are [io.netty:netty-transport-native-unix-common:4.1.49.Final] 2 | Community Dependencies present in old build which are not present in new build are [com.google.android:annotations:4.1.1.4, org.codehaus.mojo:animal-sniffer-annotations:1.18] 3 | artifacts present in new build and not present in old build are [com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2, com.fasterxml.jackson.core:jackson-databind:2.11.2, com.fasterxml.jackson.dataformat:jackson-dataformats-text:2.11.2] 4 | nonexistent-redhat-deps present in new build and not present in old build are ['io.quarkus:quarkus-bom:1.3.4.Final',] 5 | The new licenses added to this build are [GNU General Public License v2.0 only, GNU Lesser General Public License v3.0 or later] 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/new-prod-deliverable-stub.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Artifacts List 6 | 7 | 8 |

11 | 12 | 13 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/nonexistent-redhat-deps1.txt: -------------------------------------------------------------------------------- 1 | 'org.mongodb:bson:4.1.0:', 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/nonexistent-redhat-deps2.txt: -------------------------------------------------------------------------------- 1 | 'io.quarkus:quarkus-bom:1.3.4.Final', 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/old-prod-deliverable-stub.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Artifacts List 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/quarkus-1.0.0-licenses.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/pig/src/test/resources/__files/quarkus-1.0.0-licenses.zip -------------------------------------------------------------------------------- /pig/src/test/resources/__files/quarkus-1.0.1-licenses.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/project-ncl/bacon/e79db19bc704d03219c1751faff199bb6345d8ea/pig/src/test/resources/__files/quarkus-1.0.1-licenses.zip -------------------------------------------------------------------------------- /pig/src/test/resources/__files/repository-artifact-list1.txt: -------------------------------------------------------------------------------- 1 | com.cronutils:cron-utils:9.1.1 2 | com.fasterxml.jackson.core:jackson-annotations:2.11.2 3 | com.fasterxml.jackson.core:jackson-core:2.11.2 4 | -------------------------------------------------------------------------------- /pig/src/test/resources/__files/repository-artifact-list2.txt: -------------------------------------------------------------------------------- 1 | com.cronutils:cron-utils:9.1.1 2 | com.fasterxml.jackson.core:jackson-annotations:2.11.2 3 | com.fasterxml.jackson.core:jackson-core:2.11.2 4 | com.fasterxml.jackson.core:jackson-databind:2.11.2 5 | com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2 6 | com.fasterxml.jackson.dataformat:jackson-dataformats-text:2.11.2 7 | -------------------------------------------------------------------------------- /pig/src/test/resources/build-config-custom-repo-generation.yaml: -------------------------------------------------------------------------------- 1 | product: 2 | name: mszynkie-demo 3 | abbreviation: md 4 | stage: GA 5 | issueTrackerUrl: http://example.com/demo 6 | version: 1.0.1 7 | milestone: DR16 8 | group: mszynkie demo All 9 | defaultBuildParameters: 10 | project: mszynkie-demo 11 | environmentName: "OpenJDK 1.8; Mvn 3.3.9" 12 | buildScript: mvn clean deploy -DskipTests -B 13 | builds: 14 | - name: foo-1.0 15 | scmUrl: https://github.com/michalszynkiewicz/demo-foo 16 | scmRevision: 1.0.1 17 | - name: bar-1.0 18 | scmUrl: https://github.com/michalszynkiewicz/demo-bar 19 | scmRevision: 1.0.1 20 | dependencies: 21 | - foo-1.0 22 | 23 | outputPrefixes: 24 | releaseFile: mszynkie-demo 25 | releaseDir: mszynkie-demo 26 | outputSuffix: jms 27 | flow: 28 | # licensesGeneration: gen.downloadFrom 'WildFly-Swarm' matching '.*license\.zip' 29 | licensesGeneration: 30 | strategy: GENERATE 31 | repositoryGeneration: 32 | strategy: PACK_ALL 33 | sourceBuild: bar-1.0 34 | includeJavadoc: true 35 | includeLicenses: false 36 | includeMavenMetadata: true 37 | 38 | javadocGeneration: 39 | strategy: IGNORE 40 | -------------------------------------------------------------------------------- /pig/src/test/resources/build-config.yaml: -------------------------------------------------------------------------------- 1 | product: 2 | name: mszynkie-demo 3 | abbreviation: md 4 | stage: GA 5 | issueTrackerUrl: http://example.com/demo 6 | version: 1.0.1 7 | milestone: DR16 8 | group: mszynkie demo All 9 | defaultBuildParameters: 10 | project: mszynkie-demo 11 | environmentName: "OpenJDK 1.8; Mvn 3.3.9" 12 | buildScript: mvn clean deploy -DskipTests -B 13 | builds: 14 | - name: foo-1.0 15 | scmUrl: https://github.com/michalszynkiewicz/demo-foo 16 | scmRevision: 1.0.1 17 | - name: bar-1.0 18 | scmUrl: https://github.com/michalszynkiewicz/demo-bar 19 | scmRevision: 1.0.1 20 | dependencies: 21 | - foo-1.0 22 | 23 | outputPrefixes: 24 | releaseFile: mszynkie-demo 25 | releaseDir: mszynkie-demo 26 | outputSuffix: jms 27 | flow: 28 | # licensesGeneration: gen.downloadFrom 'WildFly-Swarm' matching '.*license\.zip' 29 | licensesGeneration: 30 | strategy: GENERATE 31 | repositoryGeneration: 32 | strategy: PACK_ALL 33 | sourceBuild: bar-1.0 34 | 35 | javadocGeneration: 36 | strategy: IGNORE 37 | -------------------------------------------------------------------------------- /pig/src/test/resources/config.yaml: -------------------------------------------------------------------------------- 1 | profile: 2 | - name: "default" 3 | pnc: 4 | url: "http://orch.com" 5 | bifrostBaseurl: "http://example.com" 6 | da: 7 | url: "http://da.com" 8 | pig: 9 | licenseServiceUrl: "http://license.com" 10 | indyUrl: "http://indy.com" 11 | kojiHubUrl: "http://koji.com" 12 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/additional-file/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/additional-file/file2.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/additional-file/file3.txt: -------------------------------------------------------------------------------- 1 | file not present in the original dir 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/additional-newline/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | 7 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/additional-newline/file2.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/copy-with-file-to-be-ignored/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/copy-with-file-to-be-ignored/file2.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/copy-with-file-to-be-ignored/ignore-me: -------------------------------------------------------------------------------- 1 | This file should be skipped from the hash directory 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/copy/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/copy/file2.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/moved-file/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/moved-file/subdir/file2.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/original/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/original/file2.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/removed-file/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/renamed-file/file1.txt: -------------------------------------------------------------------------------- 1 | some file 2 | with some content 3 | 4 | 5 | the original file for the HashUtilsTest 6 | -------------------------------------------------------------------------------- /pig/src/test/resources/hash/renamed-file/file1342.txt: -------------------------------------------------------------------------------- 1 | another file 2 | -------------------------------------------------------------------------------- /pnc/src/main/java/org/jboss/pnc/bacon/pnc/AdminCli.java: -------------------------------------------------------------------------------- 1 | /* 2 | * JBoss, Home of Professional Open Source. 3 | * Copyright 2018 Red Hat, Inc., and individual contributors 4 | * as indicated by the @author tags. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.jboss.pnc.bacon.pnc; 19 | 20 | import org.jboss.pnc.bacon.pnc.admin.AnnouncementBannerCli; 21 | import org.jboss.pnc.bacon.pnc.admin.MaintenanceModeCli; 22 | import org.jboss.pnc.bacon.pnc.admin.RexCli; 23 | 24 | import picocli.CommandLine.Command; 25 | 26 | @Command( 27 | name = "admin", 28 | description = "Admin related tasks", 29 | subcommands = { AnnouncementBannerCli.class, MaintenanceModeCli.class, RexCli.class }) 30 | public class AdminCli { 31 | } 32 | -------------------------------------------------------------------------------- /pnc/src/main/java/org/jboss/pnc/bacon/pnc/common/ClientCreator.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pnc.common; 2 | 3 | import java.util.function.Function; 4 | 5 | import org.jboss.pnc.bacon.pnc.client.PncClientHelper; 6 | import org.jboss.pnc.client.ClientBase; 7 | import org.jboss.pnc.client.Configuration; 8 | 9 | import lombok.extern.slf4j.Slf4j; 10 | 11 | /** 12 | * Helper class to create the PNC CLI client to use in the CLI objects. There are two variants, the unauthenticated one 13 | * and the authenticated one. 14 | */ 15 | @Slf4j 16 | public class ClientCreator> { 17 | private final Function constructor; 18 | 19 | /** 20 | * Example: {@code ClientCreator CREATOR = new ClientCreator<>(BuildClient::new);} 21 | * 22 | * @param constructor Constructor of the client 23 | */ 24 | public ClientCreator(Function constructor) { 25 | this.constructor = constructor; 26 | } 27 | 28 | /** 29 | * Get a new unauthenticated PNC Client object. 30 | * 31 | * @return Unauthenticated PNC Client 32 | */ 33 | public T newClient() { 34 | return newClientPrivate(false); 35 | } 36 | 37 | /** 38 | * Get a new authenticated PNC Client object. 39 | * 40 | * @return Authenticated PNC Client 41 | */ 42 | public T newClientAuthenticated() { 43 | return newClientPrivate(true); 44 | } 45 | 46 | private T newClientPrivate(boolean authenticated) { 47 | return constructor.apply(PncClientHelper.getPncConfiguration(authenticated)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /pnc/src/test/java/org/jboss/pnc/bacon/pnc/ArtifactCliTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pnc; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | class ArtifactCliTest { 8 | 9 | @Test 10 | void testTransformIdentifierIfGAV() { 11 | String gav1 = "xom:xom:1.2.5"; 12 | String identifier1 = "xom:xom:pom:1.2.5"; 13 | 14 | String identifier2 = "toe:thumb:jar:2.0.0"; 15 | 16 | String identifier3 = "hello:world:pom:1.2.3:test"; 17 | 18 | assertEquals(ArtifactCli.transformIdentifierIfGAV(gav1), identifier1); 19 | assertEquals(ArtifactCli.transformIdentifierIfGAV(identifier2), identifier2); 20 | assertEquals(ArtifactCli.transformIdentifierIfGAV(identifier3), identifier3); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pnc/src/test/java/org/jboss/pnc/bacon/pnc/ProductVersionCliTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pnc; 2 | 3 | import static org.assertj.core.api.Assertions.*; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | class ProductVersionCliTest { 8 | 9 | @Test 10 | void validateProductVersionTest() { 11 | 12 | assertThat(ProductVersionCli.validateProductVersion("1.2")).isTrue(); 13 | assertThat(ProductVersionCli.validateProductVersion("1231.1232")).isTrue(); 14 | assertThat(ProductVersionCli.validateProductVersion("1.1232")).isTrue(); 15 | assertThat(ProductVersionCli.validateProductVersion("1000.1232")).isTrue(); 16 | 17 | assertThat(ProductVersionCli.validateProductVersion("abc")).isFalse(); 18 | assertThat(ProductVersionCli.validateProductVersion("1.2.3")).isFalse(); 19 | assertThat(ProductVersionCli.validateProductVersion("42")).isFalse(); 20 | assertThat(ProductVersionCli.validateProductVersion("42.1a")).isFalse(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pnc/src/test/java/org/jboss/pnc/bacon/pnc/common/ParameterCheckerTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.pnc.common; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import org.jboss.pnc.bacon.common.exception.FatalException; 6 | import org.junit.jupiter.api.Test; 7 | 8 | class ParameterCheckerTest { 9 | @Test 10 | void verifyRebuildOption() { 11 | try { 12 | ParameterChecker.checkRebuildModeOption("FOOBAR"); 13 | fail("No exception thrown"); 14 | } catch (FatalException ex) { 15 | assertTrue(ex.getMessage().contains("FOOBAR")); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /pnc/src/test/resources/config.yaml: -------------------------------------------------------------------------------- 1 | profile: 2 | - name: "default" 3 | pnc: 4 | url: "http://orch.com" 5 | bifrostBaseurl: "http://example.com" 6 | da: 7 | url: "http://da.com" 8 | pig: 9 | licenseServiceUrl: "http://license.com" 10 | indyUrl: "http://indy.com" 11 | kojiHubUrl: "http://koji.com" 12 | keycloak: 13 | url: "http://keycloak.com" 14 | realm: "example" 15 | username: "user" 16 | clientId: "pass" 17 | -------------------------------------------------------------------------------- /test-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.jboss.pnc.bacon 6 | parent 7 | 3.0.3-SNAPSHOT 8 | 9 | 10 | test-common 11 | 12 | 13 | 14 | org.junit.jupiter 15 | junit-jupiter-api 16 | compile 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test-common/src/main/java/org/jboss/pnc/bacon/testcommon/RemoteTest.java: -------------------------------------------------------------------------------- 1 | package org.jboss.pnc.bacon.testcommon; 2 | 3 | import static java.lang.annotation.ElementType.METHOD; 4 | import static java.lang.annotation.ElementType.TYPE; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | import org.junit.jupiter.api.Tag; 11 | import org.junit.jupiter.api.Test; 12 | 13 | /** 14 | * @author Matej Lazar 15 | */ 16 | @Target({ TYPE, METHOD }) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @Tag("remote-test") 19 | @Test 20 | public @interface RemoteTest { 21 | } 22 | --------------------------------------------------------------------------------