diff --git a/.gitignore b/.gitignore index b3f9877..eac6c11 100644 --- a/.gitignore +++ b/.gitignore @@ -1,62 +1,64 @@ # Created by .ignore support plugin (hsz.mobi) ### Android template # Built application files *.apk *.ap_ # Files for the ART/Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ out/ # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Eclipse proguard/ # Log Files *.log # Android Studio Navigation editor temp files .navigation/ # Android Studio captures folder captures/ # IntelliJ *.iml .idea # Keystore files # Uncomment the following line if you do not want to check your keystore files in. #*.jks # External native build folder generated in Android Studio 2.2 and later .externalNativeBuild # Google Services (e.g. APIs or Firebase) google-services.json # Freeline freeline.py freeline/ freeline_project_description.json # fastlane fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output fastlane/readme.md +# script stuff +/cli/config.php diff --git a/cli/config-example.php b/cli/config-example.php new file mode 100644 index 0000000..5c1fd3e --- /dev/null +++ b/cli/config-example.php @@ -0,0 +1,29 @@ +setConduitToken( CONDUIT_API_TOKEN ); + +$tasks = []; +$tasks_phid = []; + +// cache with users by phids +$USERS_BY_PHID = []; + +// https://gitpull.it/conduit/method/edge.search/ +$edge_api_parameters = [ + 'sourcePHIDs' => [ $diff_id ], + 'types' => [ 'revision.task' ], +]; + +// find Tasks attached to Diff patch +$edge_result = $client->callMethodSynchronous( 'edge.search', $edge_api_parameters ); +foreach( $edge_result['data'] as $data ) { + $tasks_phid[] = $data['destinationPHID']; +} + +// https://gitpull.it/conduit/method/maniphest.search/ +$maniphest_api_parameters = [ + 'constraints' => [ + 'phids' => $tasks_phid, + ], +]; + +// query Tasks info +$maniphest_result = $client->callMethodSynchronous( 'maniphest.search', $maniphest_api_parameters ); +foreach( $maniphest_result['data'] as $task ) { + + // append in known Tasks + $tasks[] = $task; + + // remember User PHIDs since we will need to get their extra info + $phid_task_author = $task['fields']['authorPHID']; + $phid_task_owner = $task['fields']['ownerPHID']; + $USERS_BY_PHID[ $phid_task_author ] = null; + $USERS_BY_PHID[ $phid_task_owner ] = null; +} + +// get users info from their PHID identifiers +$users_phid = array_keys( $USERS_BY_PHID ); +$users_api_parameters = [ + 'constraints' => [ + 'phids' => $users_phid, + ], +]; +$users_result = $client->callMethodSynchronous( 'user.search', $users_api_parameters ); +foreach( $users_result['data'] as $user_data ) { + $phid_user = $user_data['phid']; + $USERS_BY_PHID[ $phid_user ] = $user_data; +} + +// for each language +foreach( $I18N as $lang => $msg ) { + + $changelog_blocks = []; + + // for each Task + foreach( $tasks as $task ) { + $task_id = $task['id']; + $task_name = $task['fields']['name']; + $task_descr = $task['fields']['description']; + $phid_task_author = $task['fields']['authorPHID']; + $phid_task_owner = $task['fields']['ownerPHID']; + + $author = $USERS_BY_PHID[ $phid_task_author ]; + $owner = $USERS_BY_PHID[ $phid_task_owner ]; + + $username_author = $author['fields']['username']; + $username_owner = $owner ['fields']['username']; + $realname_author = $author['fields']['realName'] ?? null; + $realname_owner = $owner ['fields']['realName'] ?? null; + + $task_url = PHABRICATOR_HOME . "T{$task_id}"; + $url_author = PHABRICATOR_HOME . 'p/' . $username_author; + $url_owner = PHABRICATOR_HOME . 'p/' . $username_owner; + + // just try to show something useful for a F-Droid changelog + $changelog_lines = []; + + // Task name and URL + $changelog_lines[] = $task_name; + + // reporter by (author) + $changelog_lines[] = sprintf( $msg['reportedByName'], $username_author ); + + // resolved by (owner) + $changelog_lines[] = sprintf( $msg['resolvedByName'], $username_owner ); + + $changelog_lines[] = $task_url; + + $changelog_block = implode( "\n", $changelog_lines ); + $changelog_blocks[] = $changelog_block; + } + + // print all changelog blocks + $changelog_content = implode( "\n\n", $changelog_blocks ); + + // expected changelog file + $changelog_path = REPO_PATH . "/metadata/{$lang}/changelogs/{$version_code}.txt"; + + // save + file_put_contents( $changelog_path, $changelog_content ); +} diff --git a/cli/i18n.json b/cli/i18n.json new file mode 100644 index 0000000..23472bc --- /dev/null +++ b/cli/i18n.json @@ -0,0 +1,14 @@ +{ + "en-US": { + "reportedBy": "Reported by:", + "reportedByName": "Reported by %s", + "resolvedBy": "Resolved by:", + "resolvedByName": "Resolved by %s" + }, + "it": { + "reportedBy": "Segnalazione di:", + "reportedByName": "Segnalato da %s", + "resolvedBy": "Risolto da:", + "resolvedByName": "Risolto da %s" + } +} diff --git a/metadata/en-US/changelogs/46.txt b/metadata/en-US/changelogs/46.txt new file mode 100644 index 0000000..bd60720 --- /dev/null +++ b/metadata/en-US/changelogs/46.txt @@ -0,0 +1,14 @@ +Fix crash caused by NullPointerException on org.osmdroid.views.MapView.getMapCenter() (MapFragment.java:290) on version 1.18.3 +Reported by valerio.bozzolan +Resolved by fabio.mazza +https://gitpull.it/T1146 + +Fix crash caused by NullPointerException in MapFragment.java:134 on version 1.18.2 +Reported by valerio.bozzolan +Resolved by fabio.mazza +https://gitpull.it/T1142 + +Feature request - Bus list in maps pop-up +Reported by canonex +Resolved by fabio.mazza +https://gitpull.it/T1140 \ No newline at end of file diff --git a/metadata/it/changelogs/46.txt b/metadata/it/changelogs/46.txt new file mode 100644 index 0000000..7ac00c1 --- /dev/null +++ b/metadata/it/changelogs/46.txt @@ -0,0 +1,14 @@ +Fix crash caused by NullPointerException on org.osmdroid.views.MapView.getMapCenter() (MapFragment.java:290) on version 1.18.3 +Segnalato da valerio.bozzolan +Risolto da fabio.mazza +https://gitpull.it/T1146 + +Fix crash caused by NullPointerException in MapFragment.java:134 on version 1.18.2 +Segnalato da valerio.bozzolan +Risolto da fabio.mazza +https://gitpull.it/T1142 + +Feature request - Bus list in maps pop-up +Segnalato da canonex +Risolto da fabio.mazza +https://gitpull.it/T1140 \ No newline at end of file