Skip to content

Commit

Permalink
Component added
Browse files Browse the repository at this point in the history
  • Loading branch information
dukris committed Feb 15, 2024
1 parent cc5d1f4 commit cc0964d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
8 changes: 6 additions & 2 deletions src/main/java/git/tracehub/pmo/platforms/github/Github.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,23 @@
import lombok.SneakyThrows;
import org.cactoos.Scalar;
import org.cactoos.list.ListOf;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
* Github platform.
*
* @since 0.0.0
*/
@Component
@RequiredArgsConstructor

Check warning on line 39 in src/main/java/git/tracehub/pmo/platforms/github/Github.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/git/tracehub/pmo/platforms/github/Github.java#L39

Added line #L39 was not covered by tests
public final class Github implements Platform {

/**
* Host.
* Github host.
*/
private final String host;
@Value("${platforms.github}")
private String host;

@Override
@SneakyThrows

Check warning on line 49 in src/main/java/git/tracehub/pmo/platforms/github/Github.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/git/tracehub/pmo/platforms/github/Github.java#L49

Added line #L49 was not covered by tests
Expand Down
23 changes: 0 additions & 23 deletions src/main/java/git/tracehub/pmo/security/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package git.tracehub.pmo.security;

import git.tracehub.pmo.platforms.Platform;
import git.tracehub.pmo.platforms.github.Github;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
Expand All @@ -27,10 +25,7 @@
import io.swagger.v3.oas.models.security.Scopes;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import java.util.Map;
import lombok.SneakyThrows;
import org.cactoos.map.MapEntry;
import org.cactoos.map.MapOf;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -63,12 +58,6 @@ public class WebConfig {
@Value("${spring.security.oauth2.resourceserver.jwt.issuer-uri}")
private String url;

/**
* Github host.
*/
@Value("${platforms.github}")
private String github;

/**
* Filter.
*
Expand Down Expand Up @@ -151,16 +140,4 @@ name, new SecurityScheme()
);
}

/**
* Platforms.
*
* @return Map of implemented platforms
*/
@Bean
public Map<String, Platform> platforms() {
return new MapOf<>(
new MapEntry<>("github", new Github(this.github))
);
}

}

2 comments on commit cc0964d

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on cc0964d Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1-da767492 disappeared from src/main/java/git/tracehub/pmo/controller/ProjectController.java), that's why I closed #16. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on cc0964d Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:

uninitialized constant Gitlab::NotFound rescue Octokit::NotFound, Gitlab::NotFound, JIRA::NotFound => e ^^^^^^^^^^

Please, copy and paste this stack trace to GitHub:

NameError
uninitialized constant Gitlab::NotFound

  rescue Octokit::NotFound, Gitlab::NotFound, JIRA::NotFound => e
                                  ^^^^^^^^^^
/app/objects/tickets/tickets.rb:38:in `rescue in notify'
/app/objects/tickets/tickets.rb:33:in `notify'
/app/objects/tickets/milestone_tickets.rb:31:in `notify'
/app/objects/tickets/logged_tickets.rb:36:in `notify'
/app/objects/tickets/tagged_tickets.rb:31:in `notify'
/app/objects/tickets/commit_tickets.rb:32:in `notify'
/app/objects/tickets/emailed_tickets.rb:31:in `notify'
/app/objects/tickets/sentry_tickets.rb:35:in `notify'
/app/objects/diff.rb:38:in `block in notify'
/app/objects/diff.rb:33:in `each'
/app/objects/diff.rb:33:in `notify'
/app/objects/jobs/job.rb:40:in `proceed'
/app/objects/jobs/job_starred.rb:32:in `proceed'
/app/objects/jobs/job_recorded.rb:31:in `proceed'
/app/objects/jobs/job_emailed.rb:33:in `proceed'
/app/objects/jobs/job_commiterrors.rb:33:in `proceed'
/app/objects/jobs/job_detached.rb:48:in `exclusive'
/app/objects/jobs/job_detached.rb:36:in `block in proceed'
/app/objects/jobs/job_detached.rb:36:in `fork'
/app/objects/jobs/job_detached.rb:36:in `proceed'
/app/0pdd.rb:549:in `process_request'
/app/0pdd.rb:380:in `block in <top (required)>'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1804:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1804:in `block in compile!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1071:in `block (3 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1089:in `route_eval'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1071:in `block (2 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1120:in `block in process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1118:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1118:in `process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1069:in `block in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1066:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1066:in `route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1190:in `block in dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1185:in `dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1001:in `block in call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1161:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1001:in `call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:990:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/rewindable_input.rb:25:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/deflater.rb:47:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/xss_header.rb:20:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/path_traversal.rb:18:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/json_csrf.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-4.0.0/lib/rack/protection/frame_options.rb:33:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/logger.rb:19:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/common_logger.rb:43:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:266:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:259:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/head.rb:15:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-3.0.9/lib/rack/method_override.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:224:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:2115:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1674:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1890:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-4.0.0/lib/sinatra/base.rb:1674:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rackup-2.1.0/lib/rackup/handler/webrick.rb:111:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread'

Please sign in to comment.