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

ENHish: fixes #849 - NOT READY TO MERGE #860

Closed
wants to merge 2 commits into from

Conversation

wasade
Copy link
Contributor

@wasade wasade commented Feb 17, 2015

Python patches are tracked separately, and an N-1 python patch can be applied. What this means practically is that, if a python patch fails, patching execution stops. When a patch is attempted again, the patch system will check if there is a python patch that was not applied (that corresponds to the present SQL patch level), and apply it.

This is not ideal however. This requires a patch to the settings table. The settings table is not part of the qiita schema though. As a result, this table is not dropped on clean_test. What this means is that patches to the settings table cannot be done through the patch system, and either require a different mechanism or hard coded patches. This PR is doing the latter as the former is very not fun, and it is not clear if there is a benefit from the effort required to appropriately resolve the logic in the face of a production system. The other option I see is to move the settings table into the qiita schema and allow it to be dropped. Open to other suggestions here though.

@ElDeveloper
Copy link
Member

There are legitimate failures in the build.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.24%) to 78.58% when pulling 912188d on wasade:issue_849 into d398414 on biocore:master.

conn = SQLConnectionHandler()

current_patch = conn.execute_fetchone(
# Test to see if the settings table up to date. The settings table is not
Copy link
Member

Choose a reason for hiding this comment

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

table -> table is

@ElDeveloper
Copy link
Member

The other option I see is to move the settings table into the qiita schema and allow it to be dropped. Open to other suggestions here though.

I think this is the correct path to follow and avoid the inline patch that you currently have in your PR.

@ElDeveloper
Copy link
Member

Code looks good otherwise!

@ElDeveloper
Copy link
Member

👍 ... sorry for the triple email.

@antgonza
Copy link
Member

Agree with @ElDeveloper, patch is better than "fixing" on code

@josenavas
Copy link
Contributor

My only question is if such table can go into the qiita schema... I remember that there was some good reasons to keep it outside, but I don't remember right now. @adamrp @squirrelo do you remember?

@squirrelo
Copy link
Contributor

We left it outside so that the database could constantly have a marker of if it was a test database or not, independent of the actual schema. This way if the schema dropped it would still be marked as a test database or not.

@adamrp
Copy link
Contributor

adamrp commented Feb 27, 2015

@squirrelo exactly; also, IIRC running tests drops the qiita schema between
tests, and wouldn't want to drop the settings table.

On Thu, Feb 26, 2015 at 10:34 PM, Joshua Shorenstein <
notifications@github.com> wrote:

We left it outside so that the database could constantly have a marker of
if it was a test database or not, independent of the actual schema. This
way if the schema dropped it would still be marked as a test database or
not.


Reply to this email directly or view it on GitHub
#860 (comment).

@wasade
Copy link
Contributor Author

wasade commented Feb 27, 2015

It sucks so much having this separate but as long as we basically never need to modify this table, then we're fine. If we need to do additional modifications, then I think we may want to revisit whether we need to have the settings table separate, and if so, what other strategies might be apprioriate

@squirrelo
Copy link
Contributor

Since we are tracking non-static things that change as the schema is dropped, can we have a generic settings table and a qiita.settings table that holds data specific to the schema and instance? That way we don't lose the safety system of having a settings table outside the schema, but also aren't doing schema-specific things outside the schema.

@josenavas josenavas changed the title ENHish: fixes #849 ENHish: fixes #849 - NOT READY TO MERGE Mar 4, 2015
@josenavas josenavas self-assigned this Mar 4, 2015
@wasade
Copy link
Contributor Author

wasade commented Jun 30, 2015

Is this still relevant or can it be closed?

@josenavas
Copy link
Contributor

This is taking care by #1318 since the python patch is executed in the same transaction as the SQL path so if it fails the SQL path is also rollbacked.

@squirrelo
Copy link
Contributor

Can this be closed due to #1318 being merged?

@josenavas
Copy link
Contributor

Correct, this is no longer needed

@josenavas josenavas closed this Jul 25, 2015
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.

7 participants