Changeset 12588
- Timestamp:
- 05/16/2023 06:18:39 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r12587 r12588 73 73 $data = $this->export_and_parse_plugin( $plugin_slug ); 74 74 75 $readme = $data['readme']; 76 $assets = $data['assets']; 77 $headers = $data['plugin_headers']; 78 $stable_tag = $data['stable_tag']; 79 $last_committer = $data['last_committer']; 80 $last_revision = $data['last_revision']; 81 $tagged_versions = $data['tagged_versions']; 82 $last_modified = $data['last_modified']; 83 $blocks = $data['blocks']; 84 $block_files = $data['block_files']; 75 $readme = $data['readme']; 76 $assets = $data['assets']; 77 $headers = $data['plugin_headers']; 78 $stable_tag = $data['stable_tag']; 79 $last_committer = $data['last_committer']; 80 $last_revision = $data['last_revision']; 81 $tagged_versions = $data['tagged_versions']; 82 $last_modified = $data['last_modified']; 83 $blocks = $data['blocks']; 84 $block_files = $data['block_files']; 85 $current_stable_tag = get_post_meta( $plugin->ID, 'stable_tag', true ) ?: 'trunk'; 86 $touches_stable_tag = (bool) array_intersect( [ $stable_tag, $current_stable_tag ], $svn_changed_tags ); 85 87 86 88 // Release confirmation … … 131 133 if ( ! $release ) { 132 134 throw new Exception( "Plugin release {$stable_tag} not found." ); 135 } 136 137 /* 138 * If the stable release isn't confirmed, the next section will abort processing, 139 * but if this commit didn't touch a stable tag, but rather a confirmed release tag, 140 * then we need to build a new zip for that tag. 141 * 142 * This is required as ZIP building occurs at the end of the import process, yet with 143 * release confirmations the 144 */ 145 if ( ! $release['confirmed'] && ! $touches_stable_tag ) { 146 $zips_to_build = []; 147 foreach ( $svn_changed_tags as $svn_changed_tag ) { 148 // We're not concerned with trunk or stable tags. 149 if ( 'trunk' === $svn_changed_tag || $svn_changed_tag === $stable_tag ) { 150 continue; 151 } 152 153 $this_release = Plugin_Directory::get_release( $plugin, $svn_changed_tag ); 154 if ( $this_release['confirmed'] && ! $this_release['zips_built'] ) { 155 $zips_to_build[] = $this_release['tag']; 156 } 157 } 158 159 if ( $zips_to_build ) { 160 // NOTE: $stable_tag not passed, as it's not yet stable and won't be. 161 $this->rebuild_affected_zips( $plugin_slug, $current_stable_tag, $current_stable_tag, $zips_to_build, $svn_revision_triggered ); 162 } 133 163 } 134 164 … … 322 352 } 323 353 324 $current_stable_tag = get_post_meta( $plugin->ID, 'stable_tag', true ) ?: 'trunk';325 326 354 $this->rebuild_affected_zips( $plugin_slug, $stable_tag, $current_stable_tag, $svn_changed_tags, $svn_revision_triggered ); 327 355 … … 388 416 $release = Plugin_Directory::get_release( $plugin, $tag ); 389 417 390 if ( ! $release || ! $release['confirmed'] || $release['zips_built'] ) { 418 if ( 419 // If the release isn't known, skip. 420 ! $release || 421 // If the release isn't confirmed AND confirmations were required, skip. 422 ( ! $release['confirmed'] && $release['confirmations_required'] ) || 423 // If the release has had its ZIPs built, skip if it required confirmations. 424 ( $release['zips_built'] && $release['confirmations_required'] ) 425 ) { 391 426 unset( $versions_to_build[ $i ] ); 392 427 } else { … … 394 429 Plugin_Directory::add_release( $plugin, $release ); 395 430 } 396 431 } 432 433 if ( $versions_to_build ) { 434 echo "Building ZIPs for {$plugin_slug}: " . implode( ', ', $versions_to_build ) . "\n"; 397 435 } 398 436 }
Note: See TracChangeset
for help on using the changeset viewer.