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

Add check-local-portal-creds #244

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add check-local-portal-creds #244

wants to merge 4 commits into from

Conversation

netsettler
Copy link
Collaborator

  • Add a new check-local-portal-creds command.
  • Changes to Makefile:
    • Add test-full target (like test but without instafail)
    • Add SQLAlchemy 2.0 warnings

if not appname:
if 'cgap' in REPO_NAME:
appname = 'cgap'
elif 'ff' in REPO_NAME or 'ffourfront' in REPO_NAME:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean 'fourfront' not 'ffourfront'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep. Thanks for spotting that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dmichaels-harvard, I re-implemented some details of this PR in a more data-driven style to make it harder for such typos to creep in. The whole thing was too dependent on incidental string constants. See commit de10c89 for details.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK and commit b1c291d adds a bit more change.

Copy link
Member

@willronchetti willronchetti left a comment

Choose a reason for hiding this comment

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

Approving as I think the code itself is fine but I think it's still an open question whether this belongs here or in utils. I think utils makes more sense so the env bucket constants mentioned here can be bought in globally from there (instead of from snovault, which is not likely to be a useful import outside of the portals).

Comment on lines +14 to +15
CGAP_ENV_BUCKET = 'cgap-devtest-main-foursight-envs',
FOURFRONT_ENV_BUCKET = 'foursight-prod-envs'
Copy link
Member

Choose a reason for hiding this comment

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

The reason why I think this makes sense in utils rather than snovault is because these details already sort of exist there vs. here they are out of place IMO as I don't like creating a dependency on environments within snovault, feels circular.

Comment on lines +17 to +23
APP_NAMES = [APP_CGAP, APP_FOURFRONT]

APP_BUCKET_MAPPINGS = {
APP_CGAP: CGAP_ENV_BUCKET,
APP_FOURFRONT: FOURFRONT_ENV_BUCKET,
PSEUDO_APP_SNOVAULT: FOURFRONT_ENV_BUCKET, # doesn't have a bucket of its own
}
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer a structure that infers this from the calling repository, maybe by reading a file?


def main():
parser = argparse.ArgumentParser(
description='Echos version information from ~/.cgap-keys.json or override file.')
Copy link
Member

Choose a reason for hiding this comment

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

This description seems lifted from somewhere else

@netsettler
Copy link
Collaborator Author

I pushed up a fresh copy of this but then realized we installed a similar script in c4-scripts as c4-check-local-creds so it may be you just want to use that and that this branch can be deleted as redundant. The nice thing about c4-scripts is that it is able to be used from any repo, without regard to the order of inheritance. So it works for 4dn-cloud-infra for example, even if it doesn't use snovault.

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.

3 participants