Skip to content

Introduce a platform_type enum (ForgePlatformType) - #510

Open
MoralCode wants to merge 6 commits into
mainfrom
feat/platform_type
Open

MoralCode wants to merge 6 commits into
mainfrom
feat/platform_type

Conversation

@MoralCode

Copy link
Copy Markdown
Contributor

Description
This change introduces a new python Enum representing the "platform type" - a new word for the same concept we were already using, primarily in ContributorUUID. This concept assigns a magic integer of 1 for github contributors and 2 for gitlab. This enum both formalizes and renames this magic number into a ForgePlatformType, allowing us to keep the usefulness of knowing the type (i.e. API compatibility) for a given git forge, while moving it to a more appropriate structure. Previously these values were naievely stored in their own database table, platform which is being deprecated.

This PR contributes to one step of #293

Notes for Reviewers

Functionally this just adds an Enum that isnt being used anywhere.

Future PRs will address the primary task of connecting this Enum to the forge_instances table

Signed commits

  • Yes, I signed my commits.

Generative AI disclosure

Please select one option:

  • This contribution was NOT assisted or created by Generative AI tools.
  • This contribution was assisted or created by Generative AI tools.

Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…side the AugurUUID)

Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>

import uuid
import typing
from collectoss.util.enums import ForgePlatformType

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0611: Unused ForgePlatformType imported from collectoss.util.enums (unused-import)

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.

1 participant