|
83 | 83 | renamed = len(renamed_files) |
84 | 84 |
|
85 | 85 | print(f"PR {pr} changes {len(prfiles)} files.") |
86 | | -print(f"ADDED: {len(added_files)}") # just for info about the PR |
87 | | -print(f"MODIFIED: {modified}") |
88 | | -print(f"DELETED: {deleted}") |
89 | | -print(f"RENAMED: {renamed}\n") |
| 86 | +if len(added_files) > 0: |
| 87 | + print(f"ADDED {len(added_files)} files. (Added files won't cause a problem.)") |
| 88 | +if modified > 0: |
| 89 | + print(f"MODIFIED {modified} files.") |
| 90 | +if deleted > 0: |
| 91 | + print(f"DELETED {deleted} files.") |
| 92 | +if renamed > 0: |
| 93 | + print(f"RENAMED {renamed} files.\n") |
| 94 | + |
90 | 95 | # print("\nChanges that may affect azure-ai-docs-pr:\n") |
91 | 96 | data = [] # create an empty list to hold data for modified files that are referenced |
92 | 97 | nb_mods = [] # create an empty list to hold data for modified notebooks |
|
127 | 132 | # print(f"*** {cell}") |
128 | 133 | if data == []: |
129 | 134 | print( |
130 | | - "No problems with any of the modified files.\n" |
| 135 | + "✅ No problems with any of the modified files.\n" |
131 | 136 | ) |
132 | 137 | else: |
133 | 138 | # Group the data by 'Modified File' and 'Referenced In' |
|
137 | 142 | if key not in grouped_data: |
138 | 143 | grouped_data[key] = [] |
139 | 144 | grouped_data[key].append(item["Cell"]) |
140 | | - print(f"Potential problems found in {len(grouped_data)} files.") |
141 | | - print( |
142 | | - "Fix these references in azure-ai-docs-pr before approving this PR:\n" |
143 | | - ) # Print the grouped data |
| 145 | + print(f"Potential problems found in {len(grouped_data)} files. \n") |
| 146 | + # Print the grouped data |
144 | 147 | for (modified_file, referenced_in), cells in grouped_data.items(): |
145 | 148 | print(f"Modified File: {modified_file} \n Referenced in:") |
146 | 149 | refs = referenced_in.split("\n") |
|
155 | 158 |
|
156 | 159 | h.compare_branches(repo, file, "main", "temp-fix") |
157 | 160 | # also print all the modified notebooks |
| 161 | + print("⚠️ Fix all references to modified files before approving this PR.\n") |
| 162 | + |
158 | 163 | if nb_mods: |
159 | 164 | print( |
160 | 165 | "MODIFIED NOTEBOOKS\nFollow each link to ensure notebooks are valid before approving the PR:" |
161 | 166 | ) |
162 | 167 | nb_mods = list(set(nb_mods)) # remove duplicates |
163 | 168 | for file in nb_mods: |
164 | 169 | print(f"* {file}\n") |
165 | | - print("Fix all references to modified files before approving this PR.\n") |
| 170 | + print("⚠️ Fix all references to modified files before approving this PR.\n") |
166 | 171 |
|
167 | 172 | ### DELETED FILES |
168 | 173 | if deleted > 0: |
|
182 | 187 | found = +1 |
183 | 188 | if found == 0: |
184 | 189 | print( |
185 | | - "No problems with any of the deleted files.\n" |
| 190 | + "✅ No problems with any of the deleted files.\n" |
186 | 191 | ) |
187 | 192 | else: |
188 | | - print("Fix all references to deleted files before approving this PR.\n") |
| 193 | + print("⚠️ Fix all references to deleted files before approving this PR.\n") |
189 | 194 |
|
190 | 195 | ### RENAMED FILES |
191 | 196 | if renamed > 0: |
|
205 | 210 | found = +1 |
206 | 211 | if found == 0: |
207 | 212 | print( |
208 | | - "No problems with any of the renamed files.\n" |
| 213 | + "✅ No problems with any of the renamed files.\n" |
209 | 214 | ) |
210 | 215 | else: |
211 | | - print("Fix all references to renamed files before approving this PR.\n") |
| 216 | + print("⚠️ Fix all references to renamed files before approving this PR.\n") |
212 | 217 |
|
213 | 218 | print(f"\n================ {repo_name} PR summary: {pr} ===================") |
214 | 219 |
|
|
0 commit comments