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

initiate usage of pg #319

Merged
merged 2 commits into from Feb 12, 2020
Merged

Conversation

TomasTomecek
Copy link
Member

@TomasTomecek TomasTomecek commented Jan 9, 2020

This PR doesn't add any functionality. I'm adding "dead-code" pretty much. On the other hand:

  • it should make reviewing other pg-related PRs trivial
  • it will be easy for everyone to start moving data from redis to pg

Read more about alembic here: https://alembic.sqlalchemy.org/en/latest/cookbook.html#building-uptodate

@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Jan 9, 2020

Build failed.

@TomasTomecek TomasTomecek force-pushed the use-pg branch 2 times, most recently from fa46818 to 10f4743 Compare Jan 9, 2020
@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Jan 9, 2020

Build failed.

@TomasTomecek
Copy link
Member Author

TomasTomecek commented Jan 10, 2020

I just tested this locally in a cluster and it works fine.

@TomasTomecek TomasTomecek added the ready-for-review Pull request is ready for review. label Jan 10, 2020
@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Jan 10, 2020

Build failed.

Copy link
Member

@lachmanfrantisek lachmanfrantisek left a comment

I haven't tested that locally, but the models look good.

id = Column(Integer, primary_key=True) # our database PK
pr_id = Column(
String, index=True
) # GitHub PR ID - let's not make this PK since we can't control it
Copy link
Member

@lachmanfrantisek lachmanfrantisek Jan 10, 2020

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

@TomasTomecek TomasTomecek Jan 10, 2020

Choose a reason for hiding this comment

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

bear in mind that the models are really just a first pass, they definitely need a ton of improvements, that's why I didn't want to commit to create and apply real database schema

JOB_TYPE_SRPM = "SRPM"
JOB_TYPE_COPR_RPM = "COPR-RPM"
JOB_TYPE_TFT = "TFT"
Copy link
Member

@lachmanfrantisek lachmanfrantisek Jan 10, 2020

Choose a reason for hiding this comment

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

What about some enum -- will be probably useful elsewhere.

Copy link
Member Author

@TomasTomecek TomasTomecek Jan 10, 2020

Choose a reason for hiding this comment

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

as for enums:

  • didn't dig into how database engines or SA deal with enums
  • I hate when enums are represented as numbers in DB - what the F should know what 2 or 3 does stand for?
  • I hope it wouldn't be a big problem to alter the enum in future
  • actually I think I hate enums, they bring more problems than benefits

how about I just add your suggestion as a comment to the code?

Copy link
Member

@lachmanfrantisek lachmanfrantisek Jan 10, 2020

Choose a reason for hiding this comment

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

* I hate when enums are represented as numbers in DB - what the F should know what 2 or 3 does stand for?

You can use a string enum on the top of this. (So the values are strings, not ints.)

how about I just add your suggestion as a comment to the code?

👍

@TomasTomecek
Copy link
Member Author

TomasTomecek commented Jan 10, 2020

Thanks for reviews, guys.

@TomasTomecek TomasTomecek added the mergeit When set, zuul wil gate and merge the PR. label Jan 10, 2020
@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Jan 10, 2020

Build failed.

@TomasTomecek TomasTomecek removed the mergeit When set, zuul wil gate and merge the PR. label Jan 13, 2020
@jpopelka
Copy link
Member

jpopelka commented Jan 30, 2020

So what's the state? (other than needs-rebase)

@TomasTomecek
Copy link
Member Author

TomasTomecek commented Feb 6, 2020

needs-free-time

@TomasTomecek
Copy link
Member Author

TomasTomecek commented Feb 6, 2020

rebased, let's see

@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Feb 6, 2020

Build failed.

@TomasTomecek
Copy link
Member Author

TomasTomecek commented Feb 10, 2020

this was the last rebase

@TomasTomecek TomasTomecek added the mergeit When set, zuul wil gate and merge the PR. label Feb 10, 2020
@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Feb 10, 2020

Build failed.

@TomasTomecek TomasTomecek removed the mergeit When set, zuul wil gate and merge the PR. label Feb 12, 2020
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
@TomasTomecek TomasTomecek added the mergeit When set, zuul wil gate and merge the PR. label Feb 12, 2020
@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Feb 12, 2020

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

softwarefactory-project-zuul bot commented Feb 12, 2020

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 6adea3c into packit:master Feb 12, 2020
2 checks passed
@TomasTomecek TomasTomecek deleted the use-pg branch Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR. ready-for-review Pull request is ready for review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants