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

Adding python script to easily obtain key customer info #41

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

sarahraza007
Copy link

Runs commands in command line, conducts string manipulation to obtain key pieces of infromation, and saves to results file

Sarah Raza added 3 commits November 6, 2022 12:43
Runs commands in command line, conducts string manipulation
to obtain key pieces of infromation, and saves to results file
@anfelbar anfelbar marked this pull request as draft November 10, 2022 13:35
@anfelbar
Copy link
Collaborator

@sarahraza007 please update your branch to fix the CI errors. From your working branch, run git fetch and then git merge origin/main. You should push the update and that's all. We will then continue working on this branch, I have converted this PR to draft for now.

@anfelbar
Copy link
Collaborator

@sarahraza007 Thank you!
Now please, lets move the code to a subdirectory that does not exists yet so you need to create it (two directories actually). Lets put the script you made into scripts/customer-info/ directory. It may be the case we create more scripts to help us with other tasks.

scripts/customer_info.py Outdated Show resolved Hide resolved
scripts/customer_info.py Outdated Show resolved Hide resolved
@anfelbar
Copy link
Collaborator

Please, move the files you are working on to scripts/customer-info/, you need to create the customer-info folder inside the folder scripts and put your files there :)

@anfelbar
Copy link
Collaborator

@sarahraza007 just one final note before we consider merging this PR. Please add a readme.md file in the scripts/customer-info/ directory. In that file you write documentation about the script. I would expect something like

  1. Goal: what do we want to do with the script? General view. Expected result.
  2. How do we want to do it? By using aquery, cquery and so on.
  3. Current implementation. Just saying what is the script currently doing.
  4. How to execute? Show as well an output example.
  5. ....

Add more content as needed.

@anfelbar
Copy link
Collaborator

Good job @sarahraza007 !
Let's continue with some modifications.

  1. Adapt the generated file yaml with readable fields like total_actions: 47.
  2. Lets show help for the user when he does not provide enough arguments.
    For instance we can
           if len(sys.argv) < 3:
               print("NICE PARAGRAPH EXPLAINING THE ARGUMENTS WE NEED BLABLABLA")
  3. Lets add some nice prints to show progress and more. A few ideas (add whatever you see necessary)
           print("Analysing target ", target, file=sys.stderr)
           ...
           print("Extracting targets information", , file=sys.stderr)
           ...
           print("saving analysis file in path....", file=sys.stderr)
  4. Lets provide a way to explore the repository instead of giving a target. So we could do something like
    1. List the directories in the provided repository path
    2. Apply analysis for //directory and save the result in an independent file
    3. Save global results (summation of individual results) in another file

Please, also update your branch with:

git fetch 
git merge origin/main

Copy link

@vaibhav-shah vaibhav-shah left a comment

Choose a reason for hiding this comment

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

Functionality and information wise, this looks great so far!!

There is one case I am curious about - do we need to account for build options that users might pass to the Bazel CLI? For example, I might run a build with certain configurations and flags: bazel build //this/is/an:example --config=remote --incompatible_strict_action_env ...

I'm thinking we can provide a list build_options that the end user would populate before running the script. This list would then be passed to bazel cquery when we call it (cquery should support build options). Let me know your thoughts.

scripts/customer-info/customer_info.py Show resolved Hide resolved
scripts/customer-info/customer_info.yaml Outdated Show resolved Hide resolved
scripts/customer-info/customer_info.yaml Show resolved Hide resolved
//java/...:
- ' BazelJavaProtoAspect: 3'
- ''
'Configurations:':

Choose a reason for hiding this comment

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

I'd be really curious to see what this section looks like when the script is ran in another repo; details like darwin_amd64 in Execution Platforms are very helpful but the Configurations section seems a bit redundant in this example.

Copy link
Author

Choose a reason for hiding this comment

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

I ran it on the engflow directory and this is what it looked like
Screen Shot 2023-01-04 at 10 20 51 AM

scripts/customer-info/README.md Show resolved Hide resolved
@lfpino
Copy link

lfpino commented Mar 7, 2023

Can we check this in?

sarahraza007 and others added 4 commits March 12, 2023 14:30
@anfelbar
Copy link
Collaborator

Moving this to Ready for review.

@anfelbar anfelbar marked this pull request as ready for review March 14, 2023 13:20
@lfpino
Copy link

lfpino commented Mar 14, 2023

I've asked @vaibhav-shah to take over this and find a good place for this to live as a sales tool

@anfelbar
Copy link
Collaborator

Do we reached a decision on where to put this?

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.

4 participants