Commit Graph

507 Commits

Author SHA1 Message Date
Jordan Rose
49608044b7 SSK: Remove obsolete OWSMessageDecryptJob
This hasn't been used since before GRDB.
2022-04-11 14:46:43 -07:00
Evan Hahn
8b072620a6 Add "Donation Receipts" view 2022-04-11 16:21:12 -05:00
Evan Hahn
b739f739e7 Fix Python deprecation warning in reverse integration check script
This quiets the following deprecation warning:

    ./Scripts/reverse_integration_check.py:56: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      tag for tag in unmerged_tags if LooseVersion(tag) > LooseVersion(epoch_tag)

[`distutils.LooseVersion` will be removed in Python 3.12][0], and there
doesn't seem to be an equivalent in the standard library. I implemented
a simple `Version` class to replicate this functionality.

(I also looked into other solutions, such as rewriting the script in
Swift, but this seems like the right solution for now.)

[0]: https://peps.python.org/pep-0632/
2022-04-09 16:36:44 -05:00
Evan Hahn
7b09dc609e Ignore 5.23.0.22-beta tag in reverse integration check script
This adds `5.23.0.22-beta` to our list of ignored tags, to avoid this error when running the script:

    RuntimeError: 💥 Found unmerged tags: ['5.23.0.22-beta']

We saw this error when deploying 5.25.
2022-04-09 16:31:48 -05:00
Jordan Rose
8c1a31e094 auto-genstrings: Fix OWSLocalizedString breakage
genstrings warns on non-constant strings being passed to
NSLocalizedString, but that happens precisely when we define
OWSLocalizedString. Skip the two files where we define it (one for
each language).

While here:
- Use find's -exec feature rather than a separate xargs invocation.
- Make the script shellcheck-clean.
2022-04-05 10:48:05 -07:00
Michelle Linington
0f3a2b4c2e Perform emoji mapping in EmojiGenerator 2022-04-01 14:55:30 -07:00
Nora Trapp
378cc730d1 codegen 2022-03-31 00:37:56 -07:00
Nora Trapp
014fe25b16 sds codegen 2022-03-31 00:34:33 -07:00
Nora Trapp
536c7170df sds codegen 2022-03-31 00:34:32 -07:00
Nora Trapp
e95e392494 Add story context to TSInteraction 2022-03-31 00:34:32 -07:00
Evan Hahn
e8b4b8f15c Scripts: subprocess.check_output should use text=True for compatibility
In Python 2, `subprocess.check_output` returns a string. In Python 3, it
returns a byte string unless you provide `text=True`.

This makes sure all calls have that option for compatibility.

Also, my editor was auto-formatting these with [Black][0], which I
didn't prevent, so now these files are formatted a little better.

[0]: https://github.com/psf/black
2022-03-24 17:28:12 -05:00
Evan Hahn
16aa421d3e More Python 3 script fixes 2022-03-24 10:28:27 -05:00
Evan Hahn
d7c33eb211 Speed up pre-commit script
On my machine, the `./precommit.py --all` took 344.15 seconds (more than
5 minutes). This change speeds it up so that it takes less than 10
seconds.

It primarily achieves this by running `swiftlint` twice instead of twice
per file. There are some other smaller changes, too:

- Use a `set` for common operations
- Avoid a needless call to `text.split`
- Use built-in `pathlib.Path().parts` instead of a home-rolled solution

Tested this by running `./precommit.py` with all flags.
2022-03-23 09:43:21 -05:00
Evan Hahn
a7d5f778e2 Fix pre-commit block format script
Python 3 removed the [`cmp` function][0] which this script relied on.
Calling it was unnecessary, so I removed it (and cleaned up some of the
surrounding code).

Tested this with the `--all`, `--path`, and `--ref` flags.

[0]: https://docs.python.org/2.7/library/functions.html#cmp
2022-03-22 13:33:32 -05:00
Evan Hahn
c254811765 Remove unnecessary coding: utf-8 heading from Python scripts
Python 3 uses UTF-8 for source files by default. This removes the
unnecessary `coding: utf-8` declaration comment from all files.
2022-03-21 14:43:45 -05:00
Evan Hahn
1101db6a29 Upgrade scripts to Python 3
Python 2 was [removed from macOS in 12.3][0]. This change:

- Automatically converts many files with [2to3][1]
- Manually updates all [shebangs][2] to use `python3` instead of
  versionless `python` or `python2.7`
- Manually applies a few fixes, many of which were noted by 2to3
- Manually undoes a few fixes that were automatically done by 2to3

[0]: https://www.macrumors.com/2022/01/28/apple-removing-python-2-in-macos-12-3/
[1]: https://docs.python.org/3/library/2to3.html
[2]: https://en.wikipedia.org/wiki/Shebang_(Unix)
2022-03-21 12:58:33 -05:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Martin Böttcher
eedfd70f3e merged master and pod files 2022-03-15 12:49:11 +01:00
Martin Böttcher
c2d93547ae minor changes due to changed name of NSLocalizedStringFromAppBundle (now OWSLocalizedString) and new location of swift function and preprocessor definition 2022-03-11 14:08:26 +01:00
Jordan Rose
15d13517fa Add SDSCursor protocol, for common functionality across cursors 2022-03-07 15:01:39 -08:00
Martin Böttcher
c0adfbfb32 NSLocalizedString is replaced by NSLocalizedStringFromAppBundle (reading strings from the bundle of the main app) for all source files called by an app extension and the localizable files are removed for the app extension targets. 2022-03-07 13:29:06 +01:00
Michelle Linington
a348495786 Swap hands 2022-03-03 17:11:23 -08:00
Michelle Linington
614807de65 Update to Emoji 14 2022-03-03 17:11:23 -08:00
Michelle Linington
886a9f8e6f Generate CDS protos 2022-02-22 12:41:04 -08:00
Jordan Rose
61232780ee Don't reindex conversations on every model change
Every single message updates a TSThread model, but only a change in a
member's profile name or phone number, or a change to a group's model,
can update the indexing information. Turn 'shouldBeIndexedForFTS' into
a tri-state 'FTSIndexMode' with options 'never', 'manualUpdates', and
'always', and use 'manualUpdates' for TSThreads. Then explicitly
reindex on any of the changes listed above.
2022-02-01 15:05:34 -08:00
Michelle Linington
220a49134e Fix lint script 2022-01-31 11:00:13 -08:00
Michelle Linington
e19b800b17 Merge branch 'release/5.27.0' 2022-01-28 13:37:59 -08:00
Michelle Linington
e3d18733da Bump copyright 2022-01-28 13:23:47 -08:00
Jordan Rose
01fc3945ae Fix setup_private_pods script for newly-cloned repos
- The Pods/ directory always exists even before submodules have been
  initialized; check for Pods/.git instead, which may be a file or
  a folder depending on how the submodule was set up.

- When cloning for the first time, make sure the remote is called
  'private' so that later updates will reference it correctly. Also
  run `git submodule absorbgitdirs` so that git stores the submodule
  state inside the top-level .git directory.

- For an existing directory, simplify the check for the presence of
  a proper 'private' remote.

- Check that we're running from the repository root so we don't get
  weird errors or do random clones.

- Make the script Shellcheck-clean.
2022-01-28 10:04:00 -08:00
Michelle Linington
e3f1efb459 Update comment 2022-01-25 16:59:59 -08:00
Michelle Linington
30f51a10d0 Allow specifying of build variants from build tag script
ASC will assign its own build numbers to our builds independent of what
our plist requests. Right now, we're in a situation where a failed build
has forced our local and ASC variants out-of-sync. This change allows
the version flag to specify a fix to re-sync.
2022-01-25 16:56:37 -08:00
Ehren Kret
528257e705 Remove unused files 2022-01-10 10:50:09 -06:00
Matthew Chen
726fa6577f Fix bug around handling forward declarations of obj-c protocols in precommit script. 2021-11-23 14:16:35 -03:00
Nora Trapp
edc89c3db1 Store badge receipt credential presentation on the durable job 2021-11-17 15:14:03 -08:00
Eugene Bistolas
78cb9352c3 [Badging] Durable receiptCredential fetch and redemption 2021-11-15 12:47:35 -10:00
Michelle Linington
0b698fbd69 Run codegen 2021-11-09 14:25:42 -08:00
Michelle Linington
fa0d10f047 Firm up database schema 2021-11-09 14:25:42 -08:00
Michelle Linington
7a3f063276 Fix clang format 2021-11-03 13:46:03 -07:00
Michelle Linington
b4acfbcfe7 Enhancements to emoji codegen script
- Any errors that are hit are propogated out to stdout
- Notifies via stdout if a new emoji needs a component definition
- Uses Character instead of UnicodeScalar when appropriate
- Explicitly declares the RemoteModel that's in use
- Enhancements to file writing to simplify indentation
2021-11-02 14:47:26 -07:00
Michelle Linington
582426a203 Update emoji script to account for new component emojis 2021-11-02 14:47:26 -07:00
Matthew Chen
9211ac8fa3 Move MobileCoin SDK to SignalUI. 2021-11-02 14:26:03 -03:00
Matthew Chen
153095a500 Reduce statics. 2021-11-02 10:36:25 -03:00
Matthew Chen
9963df1f23 Reduce statics. 2021-11-02 10:36:25 -03:00
Matthew Chen
8472571d0a Rename NSE. 2021-10-28 11:40:26 -03:00
Michelle Linington
98f9fcc9ad Fix emoji generator script to not re-add warnings 2021-10-21 21:30:56 -07:00
Michelle Linington
77b7ea5c40 Fix a whole bunch of warnings 2021-10-21 21:11:26 -07:00
Matthew Chen
a0efdc2e95 Respond to CR. 2021-10-21 09:21:33 -03:00
Matthew Chen
eca3fdf26f Respond to CR. 2021-10-21 09:21:33 -03:00
Matthew Chen
03abd1c398 Respond to CR. 2021-10-21 09:21:33 -03:00
Matthew Chen
91ad7d1df7 Respond to CR. 2021-10-21 09:21:31 -03:00