- 
                Notifications
    You must be signed in to change notification settings 
- Fork 14
Improved kubestronauts ambassadors handling scripts #35
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
          
     Merged
      
      
            jeefy
  merged 4 commits into
  main
from
Improved_kubestronauts_Ambassadors_Handling_Scripts
  
      
      
   
  May 11, 2025 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
  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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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 | 
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| # Projects list | ||
| wget https://landscape.cncf.io/api/projects/all.json | ||
| jq '.[] | select(.accepted_at) | .name' all.json | cut -d'"' -f2 > CNCF-Project-list.txt | ||
|  | ||
|  | ||
| # Get the secrets from https://console.cloud.google.com/auth/clients/, store it under credentials.json and run the script | ||
| python3 CNCFInsertAmbassadorInPeople_json.py -fl 2 -ll 45 | ||
| # You will be prompted to login | 
  
    
      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,6 @@ | ||
| pygsheets | ||
| gdown | ||
| pandas | ||
| urllib3==1.26.6 | ||
| pygsheets==2.0.6 | ||
| python-dotenv | 
  
    
      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
    
  
  
    
              
  
    
      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,58 @@ | ||
| import csv | ||
| import json | ||
| import os | ||
| from collections import OrderedDict | ||
| import argparse | ||
| import shutil | ||
| import pygsheets | ||
| import pandas as pd | ||
| from dotenv import load_dotenv | ||
|  | ||
|  | ||
|  | ||
| parser = argparse.ArgumentParser(description='Ack the reception of a Kubestronaut in the sheet') | ||
|  | ||
| parser.add_argument('-e','--email', help='', required=True) | ||
| args = vars(parser.parse_args()) | ||
|  | ||
| email = args['email'] | ||
|  | ||
| load_dotenv() | ||
| # Store credentials | ||
| pwd = os.getenv('KUBESTRONAUT_RECEIVERS') | ||
|  | ||
|  | ||
| # Let's open the GoogleSheet to write Kubestronaut info + coupons | ||
| #authorization | ||
| gc = pygsheets.authorize(service_file='kubestronauts-handling-service-file.json') | ||
| #open the google spreadsheet | ||
| sh = gc.open_by_key(KUBESTRONAUT_RECEIVERS) | ||
| #select the first sheet | ||
| wks = sh[0] | ||
|  | ||
| NON_acked_Kubestronauts=[] | ||
|  | ||
| list_kubestronauts_cells=wks.find(pattern=email, cols=(2,2), matchEntireCell=False) | ||
| number_matching_cells = len(list_kubestronauts_cells) | ||
|  | ||
| if (number_matching_cells==1): | ||
| email_cell = list_kubestronauts_cells[0] | ||
| wks.update_value("G"+str(email_cell.row),"") | ||
| cell_f2 = wks.cell('F2') | ||
| bg_color_f2 = cell_f2.color | ||
|  | ||
| cell=wks.cell("F"+str(email_cell.row)) | ||
| cell.color = bg_color_f2 | ||
| print("F"+str(email_cell.row)) | ||
| print("Kubestronaut with email "+email+" : ACKed") | ||
| elif (number_matching_cells==0): | ||
| print("Kubestronaut with email "+email+" not found !!") | ||
| NON_acked_Kubestronauts.append(email) | ||
| else: | ||
| print("Kubestronaut with email "+email+" found multiple times !!") | ||
| NON_acked_Kubestronauts.append(email) | ||
|  | ||
| if NON_acked_Kubestronauts: | ||
| print("List of Kubestroauts that were NOT ACKED:") | ||
| for email_address in NON_acked_Kubestronauts: | ||
| print("\t"+email_address) | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huats I was looking at this list of file types working thru it to consider if they had any impact on the external GHA work and I was thinking that it would probably be fine.
But then I noticed that there is a json file in this PR (suggestions.json) are you sure you want to **/*.json files in .gitgnore moving forward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback. Happy to keep the .json out of the gitignore file if needed of course. But since it is a working directory that has (on my end) a lot of tokens and credentials it was simply easier like this...
Please let me know what you prefer and I'll follow your judgement