- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13
 
Adding python script to easily obtain key customer info #41
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
          
     Open
      
      
            sarahraza007
  wants to merge
  27
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
sarah/understand-customer-script
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 5 commits
      Commits
    
    
            Show all changes
          
          
            27 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      05c549c
              
                Adding python script to easily obtain key customer info
              
              
                 3ca9d79
              
                added file writing capability
              
              
                 5aaa42e
              
                Merge branch 'main' into sarah/understand-customer-script
              
              
                 d31f707
              
                Merge remote-tracking branch 'origin/main' into sarah/understand-cust…
              
              
                 4d16539
              
                changed directory
              
              
                 21e9ed6
              
                removed comments, added command
              
              
                 9f2fa21
              
                added new folder
              
              
                 cd2988c
              
                added cquery
              
              
                 cad6ce9
              
                Added flag functionality and readme file
              
              
                 93a3a3e
              
                added in comments, removed unecessary import
              
              
                 8687ab4
              
                Fixed aquery formatting, added in target as arg, added execute functi…
              
              
                 08bfd12
              
                removed unecessary comment
              
              
                 0253986
              
                Merge remote-tracking branch 'origin/main' into sarah/understand-cust…
              
              
                 677f3fd
              
                fixed formatting, added error messages, added progress messages
              
              
                 fb015a2
              
                added support for repo paths but data is unorganized, no option for s…
              
              
                 9a34d4c
              
                Added in target organization for action info
              
              
                 e1e7a35
              
                Merge remote-tracking branch 'origin/main' into sarah/understand-cust…
              
              
                 850d543
              
                Merge remote-tracking branch 'origin/main' into sarah/understand-cust…
              
              
                 d48b5ad
              
                added docstrings
              
              
                 9869462
              
                added action summing
              
              
                 7bd919c
              
                increased time out time
              
              
                 e9c4c2a
              
                added support for user options, reorganized bazel targets to be more …
              
              
                 bdf4edd
              
                remvoed TODOs
              
              
                 2941e96
              
                Update scripts/customer-info/README.md
              
              
                sarahraza007 4af3a40
              
                Update scripts/customer-info/README.md
              
              
                sarahraza007 8781a33
              
                Update scripts/customer-info/README.md
              
              
                sarahraza007 6fdd011
              
                changed flags to more relevant ones
              
              
                 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import os | ||
| import yaml | ||
| 
     | 
||
| # change this based on customer repo path | ||
| repo_path = "/" | ||
| 
     | 
||
| # change path for targets as relevant, relative to repo | ||
| bazel_target_command = "bazel cquery //java/..." | ||
| 
     | 
||
| # change path for actions as relevant, relative to repo | ||
| bazel_action_command = "bazel aquery //java/..." | ||
| 
     | 
||
| 
     | 
||
| def writeToFile(dict_file): | ||
| print(dict_file) | ||
| with open(r'scripts/customer_info.yaml', 'w') as file: | ||
| yaml.dump(dict_file, file) | ||
| 
     | 
||
| 
     | 
||
| if __name__ == '__main__': | ||
| # dictionary with information | ||
| dict_file = {} | ||
| 
     | 
||
| # move to customer project | ||
| os.chdir(repo_path) | ||
| 
     | 
||
| # get bazel version | ||
| bazel_version = os.popen("bazel --version").read() | ||
| print("bazel_version var", bazel_version) | ||
| dict_file["bazel version"] = bazel_version.strip() | ||
| 
     | 
||
| # get targets | ||
| # bazel_target = os.popen(bazel_target_command).read() | ||
| # print("bazel_target var", bazel_target) | ||
| 
     | 
||
| # get actions | ||
| # bazel_action = os.popen(bazel_action_command).read() | ||
| # print("bazel_target var", bazel_action) | ||
                
      
                  sarahraza007 marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| writeToFile(dict_file) | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bazel version: bazel 5.2.0 | 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.