Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate opa-client-go lib and reduce excessive OPA logging #60

Merged
merged 3 commits into from Apr 1, 2024

Conversation

elizhuh
Copy link
Contributor

@elizhuh elizhuh commented Feb 29, 2024

Description

What

  • Integrate opa-client-go.
  • The service is already switched to S3 regional buckets in previous ticket.
  • Reduce excessive logging from the OPA sidecar container, integrated all changes proposed in UPPSF-5006.

Why

UPPSF-4874

Anything, in particular, you'd like to highlight to reviewers

  • Reworked the rego policy associated with this service, related PR.

Scope and particulars of this PR (Please tick all that apply)

  • Tech hygiene (dependency updating & other tech debt)

DoD - Ensure all relevant tasks are completed before marking this PR as "Ready for review"

  • Test coverage is not significantly decreased
  • All PR checks have passed
  • Changes are deployed on dev before asking for review
  • Documentations remains up-to-date

This Pull Request follows the rules described in our Pull Requests Guide

@elizhuh elizhuh force-pushed the feature/UPPSF-4874-integrate-OPA-lib branch 2 times, most recently from 0334ace to ef8c10a Compare February 29, 2024 15:53
Copy link
Contributor

@ilian2233 ilian2233 left a comment

Choose a reason for hiding this comment

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

LGTM, but let's test it on dev to see if anything pops up.

processor/msg_processor.go Outdated Show resolved Hide resolved
@elizhuh elizhuh force-pushed the feature/UPPSF-4874-integrate-OPA-lib branch 2 times, most recently from 60acebb to 5416423 Compare March 15, 2024 14:29
@coveralls
Copy link

coveralls commented Mar 15, 2024

Coverage Status

coverage: 56.905% (+4.7%) from 52.247%
when pulling 3251293 on feature/UPPSF-4874-integrate-OPA-lib
into eb8008a on master.

@elizhuh elizhuh force-pushed the feature/UPPSF-4874-integrate-OPA-lib branch 4 times, most recently from 9880e59 to a5dcfbb Compare March 19, 2024 09:38
@elizhuh elizhuh marked this pull request as ready for review March 19, 2024 10:21
@elizhuh elizhuh requested review from a team as code owners March 19, 2024 10:21
@elizhuh
Copy link
Contributor Author

elizhuh commented Mar 19, 2024

LGTM, but let's test it on dev to see if anything pops up.

@ilian2233 After resolving the CircleCI issues, I was able to deploy and test all scenarios on dev. Please review again, feel free to test on dev if you have the time to do so. I am ok to proceed with this after I receive the necessary approvels.

antoanFT
antoanFT previously approved these changes Mar 20, 2024
todor-videv1
todor-videv1 previously approved these changes Mar 21, 2024
Copy link

@todor-videv1 todor-videv1 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@ManoelMilchev ManoelMilchev left a comment

Choose a reason for hiding this comment

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

LGTM! Just need to change the circleci setup and we should be good to go.

.circleci/config.yml Outdated Show resolved Hide resolved
tsvetko24
tsvetko24 previously approved these changes Mar 22, 2024
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@elizhuh elizhuh changed the title Integrate opa-client-go lib Integrate opa-client-go lib and reduce excessive OPA logging Mar 26, 2024
@elizhuh elizhuh dismissed stale reviews from tsvetko24 and todor-videv1 via e518417 March 26, 2024 09:19
@elizhuh elizhuh force-pushed the feature/UPPSF-4874-integrate-OPA-lib branch from e518417 to 3251293 Compare March 26, 2024 09:31
@@ -138,7 +140,7 @@ func main() {
Desc: "Open policy agent sidecar address",
EnvVar: "OPEN_POLICY_AGENT_ADDRESS",
})
openPolicyAgentPolicyPath := app.String(cli.StringOpt{
opaPolicyPath := app.String(cli.StringOpt{
Copy link
Contributor

Choose a reason for hiding this comment

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

on a general level we can use the new way of getting env vars using caarlos0 library. You can check how we are doing it here for reference: https://github.com/Financial-Times/public-content-relation-api/blob/main/pkg/config/config.go

Example: Name string env:"APP_NAME" envDefault:"public-content-relation-api"``

Copy link
Contributor Author

@elizhuh elizhuh Apr 1, 2024

Choose a reason for hiding this comment

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

Thanks for the approval of the PR and this suggestion, Toni, I will definitely check it out for my next code changes.

@elizhuh elizhuh merged commit eaa0ec6 into master Apr 1, 2024
3 checks passed
@elizhuh elizhuh deleted the feature/UPPSF-4874-integrate-OPA-lib branch April 1, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants