MCPcopy Create free account
hub / github.com/apache/datafusion / update_governance_file

Function update_governance_file

docs/scripts/update_committer_list.py:147–239  ·  view source on GitHub ↗

Update the governance file with the latest committer information.

(file_path: str)

Source from the content-addressed store, hash-verified

145
146
147def update_governance_file(file_path: str):
148 """Update the governance file with the latest committer information."""
149 try:
150 with open(file_path, 'r') as f:
151 content = f.read()
152 except FileNotFoundError:
153 print(f"Error: File {file_path} not found")
154 return False
155
156 # Parse existing committers
157 existing_committers = parse_existing_table(content)
158 print(f"Found {len(existing_committers)} existing committers")
159
160 # Get ASF roster
161 asf_pmcs, asf_committers = get_asf_roster()
162 print(f"Found {len(asf_pmcs)} PMCs and {len(asf_committers)} committers in ASF roster")
163
164
165 # Create a map of existing committers by apache id
166 existing_by_apache = {c.apache: c for c in existing_committers}
167
168 # Update the entries based on the ASF roster
169 updated_committers = []
170 for apache_id, name in {**asf_pmcs, **asf_committers}.items():
171 role = 'PMC' if apache_id in asf_pmcs else 'Committer'
172 if apache_id in existing_by_apache:
173 existing = existing_by_apache[apache_id]
174 # Preserve PMC Chair role if already set
175 if existing.role == 'PMC Chair':
176 role = 'PMC Chair'
177 updated_committers.append(Committer(
178 name=existing.name,
179 apache=apache_id,
180 github=existing.github,
181 affiliation=existing.affiliation,
182 role=role
183 ))
184 # add a new entry for new committers with placeholder values
185 else:
186 print(f"New entry found: {name} ({apache_id})")
187 # Placeholder github and affiliation
188 updated_committers.append(Committer(
189 name=name,
190 apache=apache_id,
191 github="", # user should update
192 affiliation="", # User should update
193 role=role
194 ))
195
196
197 # Sort the committers
198 sorted_committers = sort_committers(updated_committers)
199
200 # Generate new table
201 table_lines = [
202 "| Name | Apache ID | github | Affiliation | Role |",
203 "|-------------------------|-----------|----------------------------|-------------|-----------|"
204 ]

Callers 1

mainFunction · 0.85

Calls 10

parse_existing_tableFunction · 0.85
get_asf_rosterFunction · 0.85
CommitterClass · 0.85
sort_committersFunction · 0.85
generate_table_rowFunction · 0.85
readMethod · 0.80
itemsMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…