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

Updating --cds-items option in epicsqarch-qs #384

Merged
merged 11 commits into from
Jul 9, 2024

Conversation

c-tsoi
Copy link
Contributor

@c-tsoi c-tsoi commented Jun 20, 2024

Description

I updated --cds-items to include a parser that helps the users find their experiments better. It handles a few different formats for the experiment name and if it can't find it right away it allows the user to input in the relevant information.

Motivation and Context

It was requested by Vincent, the previous version required you to know the run number and proposal id. This way is slightly more interactive and allows you to 'search' for the experiment.

How Has This Been Tested?

I didn't do any unit testing. I just tested it will all of the proposal id formats that I saw in the questionnaire and what was returned from getProposalsList from psdm_qs_cli.

Where Has This Been Documented?

Pre-merge checklist

  • Code works interactively (a real hutch config file can be loaded)
  • Code contains descriptive docstrings, including context and API
  • New/changed functions and methods are covered in the test suite where possible
  • Test suite passes locally
  • Test suite passes on GitHub Actions
  • Ran docs/pre-release-notes.sh and created a pre-release documentation page
  • Pre-release docs include context, functional descriptions, and contributors as appropriate

@c-tsoi
Copy link
Contributor Author

c-tsoi commented Jun 20, 2024

I have to fix a bunch of things, something happened when I did a git pull.

@c-tsoi c-tsoi marked this pull request as draft June 20, 2024 17:40
@ZLLentz
Copy link
Member

ZLLentz commented Jun 21, 2024

Don't worry about the pip build failures, there's some disturbance in the python-ci-sphere right now due to some major package releases. I'll work through these in a follow-up PR.

I'll review the contents of your PR now.

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I like this a lot!

I have a ton of comments about maintenance/code health (thinking about the lifetime of the code beyond this PR) and not a lot about your intended changes, which look good.

@@ -7,6 +7,7 @@
import sys
from dataclasses import dataclass

from kerberos import GSSError
Copy link
Member

Choose a reason for hiding this comment

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

This technically adds a pykerberos dependency to hutch-python. It's already an implicit dependency because it's used by some of our dependencies, but it's good practice to call out explicit dependencies in the package files in case a sub-dependency stops requiring it.

pykerberos needs to be added to conda-recipe/meta.yaml and to requirements.txt on this technicality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I decided to add this statement when I was trying to understand how Kerberos tokens work on our hutch machines. Do all hutch-opr machines have a Kerberos tokens?

Copy link
Member

Choose a reason for hiding this comment

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

Think of kerberos as a centralized authentication service. Every normal user on each of our servers on the network should be able to get kerberos tokens.

That being said, hutch *opr users don't normally get kerberos tokens... Maybe we need to do something special for these again? In the past these have accessed the questionnaire via hard-coded read-only username/password pairs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, yeah, maybe we could do something special? I think Vincent wanted this to be able to run from an opr account. Or maybe we could do a read-only URL or something? If that's a thing.

Copy link
Member

Choose a reason for hiding this comment

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

In the past we passed in a username and password into the init for QuestionnaireClient that came from a file in the opr home area:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do all the opr machines still have this file? I can try to implement this.

Copy link
Member

Choose a reason for hiding this comment

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

iirc all the opr home areas have this file
check out your favorite opr's home and find .web.cfg

$ ll /cds/home/opr/*/.web.cfg
-rw-rw-r-- 1 cxiopr cxiopr 63 Aug 27  2020 /cds/home/opr/cxiopr/.web.cfg
-rw-rw-r-- 1 mecopr mecopr 63 Nov  6  2023 /cds/home/opr/mecopr/.web.cfg
-rw-r--r-- 1 mfxopr mfxopr 63 Oct 16  2020 /cds/home/opr/mfxopr/.web.cfg
-rw-rw-r-- 1 rixopr xs     63 Apr 20  2021 /cds/home/opr/rixopr/.web.cfg
-rw-rw-r-- 1 tmoopr ps-tmo 63 Apr 15  2021 /cds/home/opr/tmoopr/.web.cfg
-rw-r--r-- 1 xcsopr xcsopr 63 Aug 27  2020 /cds/home/opr/xcsopr/.web.cfg
-rw-r--r-- 1 xppopr xppopr 63 Aug 27  2020 /cds/home/opr/xppopr/.web.cfg

hutch_python/epics_arch.py Show resolved Hide resolved
hutch_python/epics_arch.py Outdated Show resolved Hide resolved
hutch_python/epics_arch.py Outdated Show resolved Hide resolved
hutch_python/epics_arch.py Outdated Show resolved Hide resolved
hutch_python/epics_arch.py Show resolved Hide resolved
hutch_python/epics_arch.py Show resolved Hide resolved
hutch_python/epics_arch.py Outdated Show resolved Hide resolved
hutch_python/epics_arch.py Outdated Show resolved Hide resolved
hutch_python/epics_arch.py Outdated Show resolved Hide resolved
conda-recipe/meta.yaml Outdated Show resolved Hide resolved
@ZLLentz
Copy link
Member

ZLLentz commented Jul 8, 2024

Hey the tests are running again! Great!
I'm going to go through this one more time as a reviewer

requirements.txt Outdated Show resolved Hide resolved
@ZLLentz
Copy link
Member

ZLLentz commented Jul 8, 2024

By and large this is very good, just the two remaining things:

  • The extra row of ------------ in the structured docstring that will break the html generation
  • The package order in requirements.txt

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I'm happy with this!
If you're happy and finished, feel free to mark this as "ready for review" (currently marked as a draft) and click merge if you want (or I'll click if for you)
You should also click the "Update branch" button

@c-tsoi
Copy link
Contributor Author

c-tsoi commented Jul 9, 2024

I feel like it is good, are you satisfied with the new cases that I added to filter the commissioning experiments? I think we covered as many cases as we can.

@ZLLentz
Copy link
Member

ZLLentz commented Jul 9, 2024

Yes, I think you've done your full due diligence with your regex filters. It could miss an oddly named one here or there but there's only so much we can do with finite time. I suspect it wouldn't make sense to change them again unless we get another new naming convention.

@c-tsoi
Copy link
Contributor Author

c-tsoi commented Jul 9, 2024

OK, that sounds good. That was my only concern, Ill covert it and update now.

@c-tsoi c-tsoi marked this pull request as ready for review July 9, 2024 21:03
@c-tsoi c-tsoi merged commit 8bfca4c into pcdshub:master Jul 9, 2024
11 checks passed
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