Skip to content

Add check-local-portal-creds#244

Open
netsettler wants to merge 4 commits intomasterfrom
kmp_misc_20230214
Open

Add check-local-portal-creds#244
netsettler wants to merge 4 commits intomasterfrom
kmp_misc_20230214

Conversation

@netsettler
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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