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

Draft: GitLab events / parsing refactoring #2586

Closed
wants to merge 0 commits into from

Conversation

mfocko
Copy link
Member

@mfocko mfocko commented Oct 17, 2024

TODO:

  • Write new tests or update the old ones to cover new functionality.
  • Update doc-strings where appropriate.
  • Update or write new documentation in packit/packit.dev.
  • ‹fill in›

Fixes #2471

Related to

Merge before/after

RELEASE NOTES BEGIN

Packit now supports automatic ordering of ☕ after all checks pass.

RELEASE NOTES END

@mfocko mfocko requested a review from a team as a code owner October 17, 2024 09:47
@mfocko mfocko marked this pull request as draft October 17, 2024 09:47
Copy link
Contributor

majamassarini
majamassarini previously approved these changes Oct 17, 2024
Copy link
Member

@majamassarini majamassarini left a comment

Choose a reason for hiding this comment

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

Thank you 🙏🏻
Looking at this I think I would like to have more namespaces in our code. I would like to have github.PullRequestEvent or even better event.github.PullRequest instead of GithubPullRequestEvent. I don't know what others think about it and I don't know if this could be the right moment for such a big refactoring... but still I think it would be nicer 🙂

@majamassarini majamassarini self-requested a review October 17, 2024 10:13
@majamassarini majamassarini dismissed their stale review October 17, 2024 10:14

Sorry I didn't realize it was still a draft.

@majamassarini majamassarini removed their request for review October 17, 2024 10:15
@mfocko
Copy link
Member Author

mfocko commented Oct 17, 2024

Thank you 🙏🏻 Looking at this I think I would like to have more namespaces in our code. I would like to have github.PullRequestEvent or even better event.github.PullRequest instead of GithubPullRequestEvent. I don't know what others think about it and I don't know if this could be the right moment for such a big refactoring... but still I think it would be nicer 🙂

I'm thinking about it too :D and I will need to do some changes around anyways, so… the biggest issue is fixing the imports afterwards :D

@mfocko
Copy link
Member Author

mfocko commented Oct 17, 2024

I'm thinking about it too :D and I will need to do some changes around anyways, so… the biggest issue is fixing the imports afterwards :D

I think it will break everything, so… let's do it \o/

@mfocko
Copy link
Member Author

mfocko commented Oct 17, 2024

How about…

packit_service.worker.events
|- abstract
|  |- AbstractForgeIndependentEvent
|  `- AbstractResultEvent
|- github
|  |- abstract
|  |  `- AbstractGithubEvent
|  |- pull_request
|  |  |- Comment
|  |  `- Update # ← not sure here, right now it's just PullRequestGithubEvent, covers create and push
…

@lbarcziova @majamassarini @packit/the-packit-team

The bigger issue how to fit the downstream events in there… Do they even count as downstream-only if they come from both GitLab and Pagure? It almost feels like there should be two parsers (parsing Fedora Messaging event) returning the same type (downstream event) regardless of whether it's from GitLab or Pagure. We shouldn't even care about this…

I don't want to add another layer of events.upstream.github.… (#матрёшка) :/

@lbarcziova
Copy link
Member

It almost feels like there should be two parsers (parsing Fedora Messaging event) returning the same type (downstream event) regardless of whether it's from GitLab or Pagure.

you are right, this is probably how it should be done the most correctly

but otherwise the proposal looks good to me! Is it manageable to have it like that considering your note about upstream vs downstream? @mfocko

@mfocko
Copy link
Member Author

mfocko commented Oct 18, 2024

you are right, this is probably how it should be done the most correctly

but otherwise the proposal looks good to me! Is it manageable to have it like that considering your note about upstream vs downstream? @mfocko

maybe

• packit_service.worker.events
  • copr
  • openscanhub
  • downstream
  • github
  • gitlab

?

I think that for the beginning I could just rename Pagure to downstream (hide the fact it's pagure) and try to make it more abstract for supporting GitLab (or potentially Forgejo too, if and when Fedora migrates)

@mfocko mfocko closed this Oct 18, 2024
@mfocko mfocko force-pushed the fix/gitlab-dg-events branch from a472ed8 to 89c111a Compare October 18, 2024 12:59
Copy link
Contributor

@mfocko
Copy link
Member Author

mfocko commented Oct 18, 2024

GitHub PLEASE /o

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.

Prepare and refactor events/parsers for CentOS Stream dist-git comments
3 participants