Skip to content

Activitylog event handler split - #3241

Merged
butonic merged 13 commits into
mainfrom
activitylog-event-handler-split
Sep 8, 2026
Merged

Activitylog event handler split#3241
butonic merged 13 commits into
mainfrom
activitylog-event-handler-split

Conversation

@butonic

@butonic butonic commented Aug 4, 2026

Copy link
Copy Markdown
Member

As part of #1312 we can now disable the event handler or http handler part of the activitylog service.

Unfortunately, the code was very intertwined. The http handler was started as a go routine of the event handler. Cleaning that up took quite a bit of work.

@butonic butonic self-assigned this Aug 4, 2026
@butonic butonic added Type:Bug Type:Maintenance E.g. technical debt, packaging, etc. labels Aug 4, 2026
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Aug 4, 2026
@butonic butonic moved this from Qualification to In Progress in OpenCloud Team Board Aug 4, 2026
@codacy-production

codacy-production Bot commented Aug 4, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 445 complexity

Metric Results
Complexity 445

View in Codacy

🟢 Coverage 37.18% diff coverage

Metric Results
Coverage variation Report missing for 81536bb1
Diff coverage 37.18% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (81536bb) Report Missing Report Missing Report Missing
Head commit (cfefb83) 88465 20903 23.63%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3241) 772 287 37.18%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@butonic
butonic marked this pull request as draft August 4, 2026 17:37
@butonic
butonic force-pushed the activitylog-event-handler-split branch from 500cccc to f3dfc80 Compare August 5, 2026 15:04
@butonic
butonic force-pushed the activitylog-event-handler-split branch 2 times, most recently from 6cc2dc2 to ee31636 Compare August 13, 2026 07:30
@butonic

butonic commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

@v-scharf There sems to be a race condition with authentication: https://ci.opencloud.rocks/repos/3/pipeline/1441/166

  Scenario Outline: user tries to generate GDPR report of other users                                              # /woodpecker/src/github.com/opencloud-eu/opencloud/tests/acceptance/features/apiGraph/userGDPRExport.feature:497
    Given user "Brian" has been created with default attributes                                                    # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And the administrator has assigned the role "<user-role>" to user "Alice" using the Graph API                  # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()
    And the administrator has assigned the role "<new-user-role>" to user "Brian" using the Graph API              # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()
    When user "Alice" tries to export GDPR report of user "Brian" to "/.personal_data_export.json" using Graph API # GraphContext::userTriesToExportGdprReportOfAnotherUserUsingGraphApi()
    Then the HTTP status code should be "400"                                                                      # FeatureContext::thenTheHTTPStatusCodeShouldBe()

    Examples:
      | user-role   | new-user-role |
      | Space Admin | Space Admin   |
      | Space Admin | User          |
      | Space Admin | User Light    |
      | Space Admin | Admin         |
      | User        | Space Admin   |
        Failed step: Given user "Alice" has been created with default attributes
        cURL error 18: SSL certificate OpenSSL verify result: self-signed certificate (18) (see https://curl.se/libcurl/c/libcurl-errors.html) for https://opencloud-server:9200/konnect/v1/token (GuzzleHttp\Exception\RequestException)
      | User        | User          |
      | User        | User Light    |
      | User        | Admin         |
      | User Light  | Space Admin   |
      | User Light  | User          |
      | User Light  | User Light    |
      | User Light  | Admin         |
      | Admin       | Space Admin   |
      | Admin       | User          |
      | Admin       | User Light    |
      | Admin       | Admin         |

@butonic
butonic marked this pull request as ready for review August 14, 2026 11:03
@butonic

butonic commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

@aduffeck @rhafer I stopped myself from also switching to pull based streams with manual ack in this PR, which is where all the commits come from. I will try to add test cases for the http and event servies that now wrap the activitylog service which implements the 'business logic' of this service.

@butonic
butonic requested review from aduffeck and rhafer August 14, 2026 11:43
@butonic
butonic force-pushed the activitylog-event-handler-split branch from 48f3116 to 6d37cc9 Compare August 19, 2026 15:36
Comment thread services/webfinger/pkg/server/http/server.go Outdated
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
@butonic
butonic force-pushed the activitylog-event-handler-split branch from a3fa4f4 to cfefb83 Compare September 7, 2026 10:52
@butonic
butonic enabled auto-merge September 8, 2026 10:31
@butonic
butonic requested review from maki5 and pbleser-oc September 8, 2026 10:31
@maki5

maki5 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@butonic overall looks good, just a small thing, in previous merged PRs we introduced a validation to prevent a case when all service components are disabled, I believe it will be good to use it in this PR as well to keep things consistent

@butonic
butonic merged commit 973dbbd into main Sep 8, 2026
66 checks passed
@butonic
butonic deleted the activitylog-event-handler-split branch September 8, 2026 12:13
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenCloud Team Board Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Bug Type:Maintenance E.g. technical debt, packaging, etc.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants