Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into feature/draft_pr_builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc3092 committed May 31, 2024
2 parents 281d614 + b0e4a2d commit c06af21
Show file tree
Hide file tree
Showing 431 changed files with 11,387 additions and 8,028 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app.organisasjon-tilgang-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: ./.github/workflows/common.workflow.frontend.yml
with:
working-directory: "apps/organisasjon-tilgang-frontend"
deploy-tag: "#deploy-test-organisasjon-tilgang-frontend"
deploy-tag: "#deploy-organisasjon-tilgang-frontend"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.arbeidsplassencv-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: ./.github/workflows/common.workflow.backend.yml
with:
working-directory: "proxies/arbeidsplassencv-proxy"
deploy-tag: "#deploy-arbeidsplassencv-proxy"
deploy-tag: "#deploy-proxy"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.dokarkiv-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
cluster: "dev-fss"
working-directory: "proxies/dokarkiv-proxy"
deploy-tag: "#deploy-proxy"
deploy-tag: "#deploy-dokarkiv-proxy"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.inst-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
cluster: "dev-fss"
working-directory: "proxies/inst-proxy"
deploy-tag: "#deploy-inst-proxy"
deploy-tag: "#deploy-proxy"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proxy.pdl-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
cluster: "dev-fss"
working-directory: "proxies/pdl-proxy"
deploy-tag: "#deploy-proxy"
deploy-tag: "#deploy-pdl-proxy"
permissions:
contents: read
id-token: write
Expand Down
4 changes: 2 additions & 2 deletions apps/adresse-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down Expand Up @@ -35,5 +35,5 @@
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>
<logger level="TRACE" name="no.nav.testnav.libs.servletcore.logging.LogRequestInterceptor" />
<logger level="TRACE" name="no.nav.testnav.libs.servletcore.logging.LogRequestInterceptor"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
2 changes: 1 addition & 1 deletion apps/brreg-stub/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
4 changes: 2 additions & 2 deletions apps/bruker-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand All @@ -24,7 +24,7 @@

<springProfile name="dev">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.reactivecore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
2 changes: 1 addition & 1 deletion apps/budpro-service/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<springProfile name="prod,dev">
<appender name="stdout_json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<encoder class="no.nav.testnav.libs.servletcore.logging.TestnavLogbackEncoder">
<throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
<rootCauseFirst>true</rootCauseFirst>
<maxDepthPerThrowable>256</maxDepthPerThrowable>
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-backend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
- application: testnav-batch-bestilling-service
- application: testnav-dollystatus
- application: testnav-oversikt-frontend
- application: testnav-tenor-search-service
outbound:
rules:
- application: generer-navn-service
Expand Down
3 changes: 1 addition & 2 deletions apps/dolly-backend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ spec:
- application: testnav-dollystatus
- application: testnav-helsepersonell-service
- application: testnav-oversikt-frontend
- application: testnav-tenor-search-service
- application: etterlatte-testdata
namespace: etterlatte
- application: statuspoll
namespace: navdig
outbound:
rules:
- application: generer-navn-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import no.nav.dolly.bestilling.pdldata.command.PdlDataOpprettingCommand;
import no.nav.dolly.bestilling.pdldata.command.PdlDataOrdreCommand;
import no.nav.dolly.bestilling.pdldata.command.PdlDataSlettCommand;
import no.nav.dolly.bestilling.pdldata.command.PdlDataSlettUtenomCommand;
import no.nav.dolly.bestilling.pdldata.command.PdlDataStanaloneCommand;
import no.nav.dolly.bestilling.pdldata.dto.PdlResponse;
import no.nav.dolly.config.Consumers;
Expand All @@ -33,8 +32,6 @@
@Service
public class PdlDataConsumer implements ConsumerStatus {

private static final int BLOCK_SIZE = 10;

private final TokenExchange tokenService;
private final WebClient webClient;
private final ServerProperties serverProperties;
Expand Down Expand Up @@ -72,19 +69,6 @@ public Mono<List<Void>> slettPdl(List<String> identer) {
.collectList();
}

@Timed(name = "providers", tags = {"operation", "pdl_delete_utenom"})
public Mono<List<Void>> slettPdlUtenom(List<String> identer) {

return tokenService.exchange(serverProperties)
.flatMapMany(token -> Flux.range(0, (identer.size() / BLOCK_SIZE) + 1)
.delayElements(Duration.ofMillis(1000))
.map(count -> new PdlDataSlettUtenomCommand(webClient,
identer.subList(count * BLOCK_SIZE, Math.min((count + 1) * BLOCK_SIZE, identer.size())),
token.getTokenValue()).call())
.flatMap(Flux::from))
.collectList();
}

@Timed(name = "providers", tags = {"operation", "pdl_opprett"})
public Flux<PdlResponse> opprettPdl(BestillingRequestDTO request) {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
package no.nav.dolly.bestilling.pdldata.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpStatus;

import static org.apache.commons.lang3.StringUtils.isNotBlank;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class PdlResponse {

private static final String FINNES_IKKE = "finnes ikke";

private String ident;
private String jsonNode;
private HttpStatus status;
private String feilmelding;

@JsonIgnore
public boolean isFinnesIkke() {

return isNotBlank(feilmelding) && feilmelding.contains(FINNES_IKKE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClientRequest;
import reactor.util.retry.Retry;

import java.time.Duration;
Expand All @@ -19,6 +20,7 @@
import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID;
import static no.nav.dolly.util.CallIdUtil.generateCallId;
import static no.nav.dolly.util.TokenXUtil.getUserJwt;
import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION;
import static org.springframework.http.HttpHeaders.AUTHORIZATION;

@Slf4j
Expand All @@ -41,6 +43,10 @@ public Flux<PensjonforvalterResponse> call() {
.uri(uriBuilder -> uriBuilder
.path(PENSJON_OPPRETT_PERSON_URL)
.build())
.httpRequest(httpRequest -> {
HttpClientRequest reactorRequest = httpRequest.getNativeRequest();
reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION));
})
.header(AUTHORIZATION, "Bearer " + token)
.header(UserConstant.USER_HEADER_JWT, getUserJwt())
.header(HEADER_NAV_CALL_ID, callId)
Expand Down Expand Up @@ -68,4 +74,4 @@ public Flux<PensjonforvalterResponse> call() {
.toList())
.build()));
}
}
}
Loading

0 comments on commit c06af21

Please sign in to comment.