Giter Club home page Giter Club logo

aphrodite's People

Contributors

baranowb avatar bayern39 avatar dependabot[bot] avatar elguardian avatar fazer1929 avatar gonthim avatar istudens avatar iweiss avatar michpetrov avatar mmarus avatar parsharma avatar rmartinc avatar rpelisse avatar ryanemerson avatar soul2zimate avatar spyrkob avatar tomashofman avatar wolfc avatar xjusko avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aphrodite's Issues

Expose a more fine-grained API

Currently all Aphrodite methods are exposed by an Aphrodite instance, this is simple for the user, however this has resulted in Aphrodite.java becoming increasingly bloated.

It could be advantageous to split Aphrodite's interface into multiple sub-managers. For example we could have:

Aphrodite aphrodite = Aphrodite.instance()
IssueTrackerManager isManager = aphrodite.getIssueTrackerManager();
isManager.searchIssues(...);

RepositoryManager repoManager = aphrodite.getRepositoryManager();
repoManager.getPatchesAssociatedWith(...);

...
// Apply to Stream Services as well

Utilising Manager classes in this way, would also allow additional features to be added without further polluting Aphrodite.java. For example, each individual 'Manager' class could expose additional options, such as getIssueTrackerByHost() etc which would allow applications to utilise individual instances of IssueTrackers directly.

Improve config handling.

Currently JSON service iterates over configs, swallows first JSON and ignores rest.
Also, NotFoundException is being overused in config parsing. Which is checked exception. On config failure, there is not much we can do, so there is no reason for it to be checked?

Add Title to Patch

Needed. I'm trying to generate a report and the description is hard to handle.

Add findAllRepositories and findAllRepositoriesInStream

add two functions in StreamService.

findAllRepositories: will return a List of URL of all repositories configured in the stream (URL cannot be duplicated)

findAllRepositoriesInStream will return a List of URL of all repositories listed for a given Stream.

JIRA Update - Not all JIRA issues have custom Flags

For example JBEAP issues have the field "customfield_12311242" which is for PM_ACK, however Wildfly issues do not have this field. This means that an update to a WFLY issue will fail with a JiraException if the PM_ACK flag is set; as the required custom field is not in the editmeta JSON object returned by Jira.

Not an issue for core issues, i.e. EAP7, however it may cause issues when trying to interact with components.

Execute requests across multiple services in parallel

Currently operations such as IssueTrackerService::searchIssues are executed sequentially by Aphrodite.class, however as these operations are independent it is possible to execute them in parallel to reduce latency.

Maven shade plugin warnings

The following warnings are present during build:

[WARNING] stax-api-1.0.1.jar, stax-api-1.0-2.jar define 37 overlappping classes: 
[WARNING]   - javax.xml.stream.XMLEventReader
[WARNING]   - javax.xml.stream.StreamFilter
[WARNING]   - javax.xml.stream.FactoryFinder$ClassLoaderFinderConcrete
[WARNING]   - javax.xml.stream.util.StreamReaderDelegate
[WARNING]   - javax.xml.stream.events.StartDocument
[WARNING]   - javax.xml.stream.EventFilter
[WARNING]   - javax.xml.stream.XMLEventWriter
[WARNING]   - javax.xml.stream.XMLStreamConstants
[WARNING]   - javax.xml.stream.events.EntityDeclaration
[WARNING]   - javax.xml.stream.events.ProcessingInstruction
[WARNING]   - 27 more...
[WARNING] jira-rest-java-client-plugin-3.0.0.jar, jira-rest-java-client-api-3.0.0.jar define 135 overlappping classes: 
[WARNING]   - com.atlassian.jira.rest.client.api.SessionRestClient
[WARNING]   - com.atlassian.jira.rest.client.api.domain.IssuelinksType
[WARNING]   - com.atlassian.jira.rest.client.api.domain.input.ValueTransformerManager
[WARNING]   - com.atlassian.jira.rest.client.api.domain.AddressableNamedEntity
[WARNING]   - com.atlassian.jira.rest.client.api.domain.input.AuditRecordBuilder
[WARNING]   - com.atlassian.jira.rest.client.api.domain.FieldType
[WARNING]   - com.atlassian.jira.rest.client.api.domain.StandardOperation
[WARNING]   - com.atlassian.jira.rest.client.api.NamedEntity
[WARNING]   - com.atlassian.jira.rest.client.api.JiraRestClient
[WARNING]   - com.atlassian.jira.rest.client.api.domain.input.AttachmentInput
[WARNING]   - 125 more...
[WARNING] jira-rest-java-client-plugin-3.0.0.jar, jira-rest-java-client-core-3.0.0.jar define 150 overlappping classes: 
[WARNING]   - com.atlassian.jira.rest.client.internal.json.VersionRelatedIssueCountJsonParser
[WARNING]   - com.atlassian.jira.rest.client.internal.async.AsynchronousIssueRestClient$3
[WARNING]   - com.atlassian.jira.rest.client.internal.json.gen.LinkIssuesInputGenerator
[WARNING]   - com.atlassian.jira.rest.client.internal.json.TimeTrackingJsonParser
[WARNING]   - com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2
[WARNING]   - com.atlassian.jira.rest.client.internal.json.OperationsJsonParser
[WARNING]   - com.atlassian.jira.rest.client.internal.json.AuditRecordsJsonParser
[WARNING]   - com.atlassian.jira.rest.client.internal.json.SearchResultJsonParser
[WARNING]   - com.atlassian.jira.rest.client.internal.json.gen.ComponentInputWithProjectKeyJsonGenerator
[WARNING]   - com.atlassian.jira.rest.client.internal.json.IssueLinkTypeJsonParser
[WARNING]   - 140 more...
[WARNING] httpmime-4.1.2.jar, jira-rest-java-client-plugin-3.0.0.jar define 15 overlappping classes: 
[WARNING]   - org.apache.http.entity.mime.FormBodyPart
[WARNING]   - org.apache.http.entity.mime.MultipartEntity
[WARNING]   - org.apache.http.entity.mime.content.FileBody
[WARNING]   - org.apache.http.entity.mime.HttpMultipart
[WARNING]   - org.apache.http.entity.mime.content.ContentBody
[WARNING]   - org.apache.http.entity.mime.content.AbstractContentBody
[WARNING]   - org.apache.http.entity.mime.content.ByteArrayBody
[WARNING]   - org.apache.http.entity.mime.content.ContentDescriptor
[WARNING]   - org.apache.http.entity.mime.HttpMultipartMode
[WARNING]   - org.apache.http.entity.mime.MIME
[WARNING]   - 5 more...
[WARNING] maven-shade-plugin has detected that some .class files
[WARNING] are present in two or more JARs. When this happens, only
[WARNING] one single version of the class is copied in the uberjar.
[WARNING] Usually this is not harmful and you can skeep these
[WARNING] warnings, otherwise try to manually exclude artifacts
[WARNING] based on mvn dependency:tree -Ddetail=true and the above
[WARNING] output
[WARNING] See http://docs.codehaus.org/display/MAVENUSER/Shade+Plugin

NullPointer if AphroditeConfig Collections are null

Affects Aphrodite-0.4.0

If a user does not specify "streamConfig" array in aphrodite.properties.json when using the properties file.

OR

The new user passes null to a collection when creating a new AphroditeConfig, then a NullPointerException is thrown.

Workaround

When using aphrodite.properties.json make sure you create an empty "streamConfigs" array.
When creating AphroditeConfig programmatically, make sure you pass an empty list instead of null.

Add reload operation to StreamServices

Currently stream data is loaded during the initialisation of a service. There should be a method to reload a stream service's data. This will be useful when an Aphrodite instance is running for a long time (e.g. on thunder)

Define SearchIssues behaviour when no criteria defined

The problem is caused by each IssueTracker service (e.g. JIRA, BZ) responding differently to empty search requests. We need to define how an Aphrodite IssueTracker implementation should handle an empty search Request.

I propose that if SearchCriteria is empty, then we should not return any results as we can ensure this without any calls to an external service and it is applicable to all IssueTrackers.

Labels in repository service

We need functionality to get, set, and remove labels

get -> it will get all the labels for a patch
set -> it will set all the labels for a patch
remove -> a label from a patch

Fail-fast behaviour of methods

Add the option for methods involving multiple issues/requests to fail-fast or proceed with errors logged.

Alternatively, change the default behaviour to fail-fast

Add AffectedVersion to Issue and clarify distinction with releases

In both JIRA and Bugzilla, there is a notion of "affected versions". For Bugzilla, the field is simply called "version" and can be set to several values. For instance, in BZ1282660, the affected version is 6.4.4.

In JIRA, the field is appropriatly named "Affected Versions", and, for instance, in JBEAP-783 the affected version is 7.0.0.DR8.

Currently, the API proposed by Aphrodite is exposing this information - which is semantically the same, through two different fields:

  • the version - which is buzgilla is the equivalent of JIRA's affected version, and
  • the version part of the Release object

So depending on the nature of the bug (JIRA or Bugzilla) you need to access the information differently. Which, IMHO, defeats the point of having Aphrodite providing an abstraction layer.

To solve that, this PR adds an AfffectedVersion (List) to the Issue itself. For a bug coming from Bugzilla, this list will contains the value associated with the 'version' field, and for JIRA the content of the affectedVersion field.

This way, there will be one, same approach to fetch this information, regardless of the nature of the bug.

patch search based on issue id on GitHub is not accurate

current aphrodite.getPatchesAssociatedWith() is general search on whole GitHub, it can get false result for instance:

Issue issue = aphrodite.getIssue(new URL("https://bugzilla.redhat.com/show_bug.cgi?id=1305960"));
List<Patch>  patches = aphrodite.getPatchesAssociatedWith(issue);

centrifugal/centrifugo#84 is in the list because id "1305960" matched one of commit sha code.

It should allow to specify target repositories defined in streams.

Error when updating JIRA issue that has 'Fix Version' set

Exception in thread "main" RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_12311240=Field 'customfield_12311240' cannot be set. It is not on the appropriate screen, or unknown.}, errorMessages=[]}]}
    at com.atlassian.jira.rest.client.internal.async.DelegatingPromise.claim(DelegatingPromise.java:47)
    at org.jboss.set.aphrodite.issue.trackers.jira.JiraIssueTracker.updateIssue(JiraIssueTracker.java:206)
    at org.jboss.set.aphrodite.Aphrodite.updateIssue(Aphrodite.java:266)
    at jar.JSONConfiguration.updateIssue(JSONConfiguration.java:83)
    at jar.JSONConfiguration.main(JSONConfiguration.java:20)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: RestClientException{statusCode=Optional.of(400), errorCollections=[ErrorCollection{status=400, errors={customfield_12311240=Field 'customfield_12311240' cannot be set. It is not on the appropriate screen, or unknown.}, errorMessages=[]}]}
    at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:173)
    at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:167)
    at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:48)
    at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:12)
    at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:285)
    at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:162)
    at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
    at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
    at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
    at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:285)
    at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:162)
    at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
    at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
    at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$1$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:46)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable$1.run(SettableFuturePromiseHttpPromiseAsyncClient.java:197)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient.runInContext(SettableFuturePromiseHttpPromiseAsyncClient.java:90)
    at com.atlassian.httpclient.apache.httpcomponents.SettableFuturePromiseHttpPromiseAsyncClient$ThreadLocalDelegateRunnable.run(SettableFuturePromiseHttpPromiseAsyncClient.java:192)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.