Commit Graph
4919 Commits
Author SHA1 Message Date
Athanasius b06e579754 PLUGINS.md: Emphasise limited use of from config import config 2022-12-01 12:14:49 +00:00
Athanasius 41d7af54b4 tests/config: Update copy of 'OUT' constants to match 'live' values
It's actually just the NAMES that got changed as part of the EDDN rework, so
this would have made no difference to the tests.  But now a grep won't find
any instance of the old names.
2022-12-01 11:46:29 +00:00
Athanasius ed7cd9adc0 FDevIDs: Changed to its master and pulled to latest 2022-11-30 09:54:12 +00:00
Athanasius 311e533d3b Merge pull request #1711 from EDCD/dependabot/pip/develop/setuptools-65.6.3
build(deps-dev): bump setuptools from 65.6.0 to 65.6.3
2022-11-28 17:31:20 +00:00
Athanasius 1f99268bae Merge pull request #1722 from EDCD/dependabot/pip/develop/safety-2.3.3
build(deps-dev): bump safety from 2.3.2 to 2.3.3
2022-11-28 17:31:06 +00:00
dependabot[bot] cd971e1ed4 build(deps-dev): bump safety from 2.3.2 to 2.3.3
Bumps [safety](https://github.com/pyupio/safety) from 2.3.2 to 2.3.3.
- [Release notes](https://github.com/pyupio/safety/releases)
- [Changelog](https://github.com/pyupio/safety/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyupio/safety/compare/2.3.2...2.3.3)

---
updated-dependencies:
- dependency-name: safety
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 17:00:58 +00:00
Athanasius e6eca7f915 Merge pull request #1713 from EDCD/dependabot/pip/develop/flake8-noqa-1.3.0
build(deps-dev): bump flake8-noqa from 1.2.9 to 1.3.0
2022-11-28 16:50:02 +00:00
Athanasius f8802745ce Merge pull request #1708 from EDCD/dependabot/pip/develop/safety-2.3.2
build(deps-dev): bump safety from 2.3.1 to 2.3.2
2022-11-28 16:49:22 +00:00
Athanasius 0122552448 develop: post-release appversion bump 2022-11-28 16:45:58 +00:00
Athanasius a9ccb7d565 translations: Updated from onesky
* The inara.py "Inara only accepts Live galaxy data" added.
Release/5.6.0
2022-11-28 15:45:06 +00:00
Athanasius 1e5d09eff4 Release 5.6.0: appversion and changelog 2022-11-28 15:39:03 +00:00
Athanasius 3f0aefd671 eddn: Fix spelling mistake in a log message 2022-11-28 15:38:34 +00:00
Athanasius ab9e5f7278 Merge branch 'enhancement/1719/edsm-api-gameversion-gamebuild' into release-5.6.0-beta1 2022-11-28 12:20:36 +00:00
Athanasius a581d889fe edsm: Add a paranoia check for changed gameversion
* In theory we would always see `Fileheader` and clear `pending[]`, but let's
  be extra paranoid and also clear it if there's a gameversion/build difference
  between the prior event and the current one.
2022-11-28 12:18:10 +00:00
Athanasius 1ec1253b48 appversion: Change to 5.6.0-alpha2 to be distinct
* This is alpha, not beta.
* We have an -alpha0 and a -beta1 already, so use -alpha2 so even that digit
  is distinct.
2022-11-28 11:08:48 +00:00
Athanasius 5743fd3803 edsm: Push gameversion/build into the queue to ensure correctness
1. Due to the _TIMEOUT on the actual `post()` of a message it would be
  possible for new entries to get queued in the meantime.  These queued
  entries could be 'in session' and end up going through pending and thus
  sent before one of the 'new session' events is detected so as to clear
  pending.  The `this.gameversion/build` could have changed in the meantime,
  so are no longer correct if game client changed.
2. So, pass in the current gameversion/build when a message is pushed into
  the queue, and parse those back out when they're pulled out of the queue.
3. Use those versions in the message, not `this.` versions.
2022-11-28 11:04:51 +00:00
Athanasius ad95041605 edsm: Send gameversion/build in all messages
* Record the 'state' version of these in `this`.
* Use those when constructing the message.
* NB: Need to check if messages can be retained in the queue across client
  changes.  Coming up ....
2022-11-28 10:51:25 +00:00
Athanasius 2ac8026e3e eddn: Allow for '' in standard_header()
`''` is Falsey, but a valid value, so we need an explicit `is not None`
test for these.
2022-11-27 17:01:28 +00:00
Athanasius a944eaf445 translations: Add new inara.py string about Live data only 2022-11-27 16:49:45 +00:00
Athanasius 81111d72bf Changelog: Correct 'Developers' header, and clarify EDDN delays
* I'd missed 'Plugin ' off 'Plugin Developers'.
* Clarification added that EDDN messages will still go through quickly if
  not delayed by user settings or an EDDN Gateway issue.
2022-11-27 16:37:37 +00:00
Athanasius 4858ec7200 Pre-Release 5.6.0-beta1: appversion & changelog Release/5.6.0-beta1 2022-11-27 16:09:06 +00:00
Athanasius d902093f0b Merge pull request #1682 from EDCD/fix/1431/eddn-replay-enhancements
Change EDDN 'replay' to using an sqlite3 DB & otherwise improve
2022-11-27 15:24:28 +00:00
Athanasius 642d1912d8 Merge pull request #1716 from EDCD/enhancement/1715/inara-live-galaxy-only
inara: Send only Live galaxy data after Update 14
2022-11-27 13:55:35 +00:00
Athanasius b3eff6ab32 monitor: Catch any failure to coerce gameversion
Also, log either the error or the success.  That will aid us in diagnosing
any future issues.
2022-11-27 13:02:54 +00:00
Athanasius 8a58220a66 inara: Send only Live galaxy data after Update 14
* Adds `monitor.is_live_galaxy()` for general use.
* Assumes Update 14 starts after 2022-11-29T09:00:00+00:00.  That's the
  currently schedule day, and recently the servers have been down by the time.
  Likelihood of them coming back *up* quickly seems slim to none.
* If we couldn't parse the `gameversion` from Journal using
  `semantic_version.Version.coerce()` this will fail, and assume we're on
  the Legacy galaxy.
2022-11-27 12:47:19 +00:00
dependabot[bot] 7a2c2ba566 build(deps-dev): bump flake8-noqa from 1.2.9 to 1.3.0
Bumps [flake8-noqa](https://github.com/plinss/flake8-noqa) from 1.2.9 to 1.3.0.
- [Release notes](https://github.com/plinss/flake8-noqa/releases)
- [Commits](https://github.com/plinss/flake8-noqa/compare/v1.2.9...v1.3.0)

---
updated-dependencies:
- dependency-name: flake8-noqa
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-25 17:00:52 +00:00
Athanasius 345938a81d eddn: Set gamebuild="" for CAPI-sourced data
Whilst setting it to the same "CAPI-<endpoint>" string as `gameversion` in
these cases would probably be OK, that's not the intent of the EDDN
documentation, which has now been clarified.
2022-11-25 15:45:07 +00:00
dependabot[bot] adb0c22ae4 build(deps-dev): bump setuptools from 65.6.0 to 65.6.3
Bumps [setuptools](https://github.com/pypa/setuptools) from 65.6.0 to 65.6.3.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v65.6.0...v65.6.3)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 17:01:18 +00:00
Athanasius 4d29eb6059 appversion: Change to 5.6.0-alpha0 for 'new EDDN code' testing
* There's a Pre-Release 5.5.1-alpha0 out there, we want to look distinct
  from it.
2022-11-24 14:42:34 +00:00
Athanasius 073afc842f eddn: New --trace-on plugins.eddn.send & other logging tweaks
* In case of apparent issues, have a `--trace-on` to better see what's (not)
  happening.

  All the old DBEUG logging, even if commented out, is now under this.
* Also added some INFO level logging for the legacy replay.jsonl conversion,
  as it should be one-time per user.
* Some additional DEBUG logging for closing down.
2022-11-24 14:09:57 +00:00
Athanasius 75af13efea Merge pull request #1710 from der-eismann/change-eddn-wiki-url
Fix URL for EDDN GitHub Link
2022-11-24 13:32:57 +00:00
Philipp Trulson c8e00304fb Fix URL for EDDN GitHub Link 2022-11-24 14:09:43 +01:00
Athanasius 32229217b2 eddn: Bail from sending queued messages if one failed
NB: This is failed *not* due to the message being 'bad' in some manner. It
will mean the Gateway timed out, refused connection etc.
2022-11-23 16:00:28 +00:00
Athanasius 0eb33e011b PLUGINS.md: Document new IsDocked state flag. 2022-11-23 15:57:25 +00:00
Athanasius 95fa9d577c eddn: Use a shorter, 10 second, delay at startup for first queue check 2022-11-23 14:20:24 +00:00
Athanasius 3d9bb64330 eddn: Remove outdated comment about replaylog rework
And using tk `parent` *is* absolutely necessary.
2022-11-23 14:12:43 +00:00
Athanasius b7769821be eddn: Send immediately if docked
This has the "are we delaying sending?" check, but without the short-circuit
for "we are actually docked right now".
2022-11-23 13:56:01 +00:00
Athanasius 524c0425fb eddn: EDDN.send_message(): Only set standard header if not already set.
Else we risk overwriting e.g. `CAPI-shipyard`.
2022-11-23 13:46:49 +00:00
Athanasius fda91df04f eddn: Working with tk after(), on timer or when docked
* An aborted attempt was made to use a thread worker, but:
  1. sqlite3 doesn't allow cross-thread use of the same sqlite3 connection.
  2. Having an on-going query on one cursor, e.g. gathering all the
    outstanding message `id`, whilst trying to DELETE a row hits a
    "database is locked" error.
* So, back to tk `after()`.  `send_message_by_id()` has been audited to ensure
  its boolean return is accurate.  So there shouldn't be any way in which to
  get hung up on a single message *other than if the EDDN Gateway is having
  issues, and thus it should be retried anyway*.  Any reason for a 'bad
  message' will cause `True` return and thus deletion of the message in
  *this* call to `queue_check_and_send()`.
* There is a new `reschedule` parameter to `queue_check_and_send()`.  If
  `True` then at the end it should re-schedule.

  There is a check in `journal_entry()` for the `Docked` event, and if this
  occurs it will schedule `queue_check_and_send()` with `reschedule` set to
  `False` so that we don't end up with multiple parallel schedulings.

  It's still possible for a docking to have coincided with a scheduled run
  and thus cause double-rate sending to EDDN, but we can live with that.

* The same scheduling mechanism is used, with a much smaller delay, to
  process more than one queued message per run.

  Hence the `have_rescheduled` bool *in* the function to indicate if a 'fast'
  reschedule has already been set.  This prevents the slow one *also* being
  set in this scenario.  The latter will be scheduled when the fast one
  found no more rows to process.
2022-11-23 13:29:47 +00:00
Athanasius f2dbfacf70 eddn: Add header for CAPI outfitting and shipyard exports 2022-11-22 17:40:33 +00:00
Athanasius f6e2504216 eddn: Fix capi_fcmaterials gameversion/build & add to CAPI commodity
* Erroneously used 'CAPI-commoodity' when it's 'CAPI-market' (name of the
  CAPI endpoint, not anything to do with EDDN schema names, and '-commodity'
  would also be wrong for that).
* Set `header` for (CAPI) `export_commodities()`.
2022-11-22 17:37:15 +00:00
Athanasius b31c8c0536 eddn: A start on ensuring header (gameversion/build) are always set 2022-11-22 17:35:17 +00:00
Athanasius 4a0518da9f eddn: Set header up properly for all journal messages
* New function `EDDN.add_header()`.
* It utilises new `this` members, set from `journal_entry()`.
2022-11-22 17:26:32 +00:00
dependabot[bot] cee29ecb22 build(deps-dev): bump safety from 2.3.1 to 2.3.2
Bumps [safety](https://github.com/pyupio/safety) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/pyupio/safety/releases)
- [Changelog](https://github.com/pyupio/safety/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyupio/safety/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: safety
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-22 17:04:24 +00:00
Athanasius 06fa3629ea eddn: OUT_EDDN_DELAY (not inverted) & further work on the sending
* The eddn parts of the OUT_EDDN_DO_NOT_DELAY -> OUT_EDDN_DELAY change.  This
  includes the 'sense' of it being inverted from what it was.
* EDDN.REPLAY_DELAY is now a float, as it's used with `time.sleep()`.  *This*
  is the 400ms value for inter-message cooldown.
* EDDN.REPLAY_PERIOD is still an int, used with tk `after()`.  This is how
  often we attempt the queue.
* EDDN.session is no longer a thing, move that part of EDDN.close() to
  EDDNSender.close().
* EDDN queue DB has `id`, not `message_id`.
* Now *looping* in the queue sender, not only sending the oldest message.
2022-11-22 16:49:02 +00:00
Athanasius 6070f82c6b OUT_EDDN_DO_NOT_DELAY should be OUT_EDDN_DELAY
* The old name was OUT_SYS_DELAY.
* Yes, this is the inverse of what we want, which is "should we not delay
  messages", but this is the legacy.
2022-11-22 16:47:17 +00:00
Athanasius 59f046ee67 eddn: First cut of periodic retry of sending messages 2022-11-22 15:51:10 +00:00
Athanasius be1ef32238 config: Minor ordering change to ensure OUT_STATION_ANY set correctly
* This depends on `OUT_EDDN_SEND_STATION_DATA` which is defined below where
  this originally was.
2022-11-22 15:30:30 +00:00
Athanasius a2d2723f49 monitor: Add an 'IsDocked' flag to monitor.state.
* This is cleaner than starting to track it in `plugins/eddn.py` specifically.
* This is literally only about if we're piloting a ship that is docked, so
  not even trying to resolve "on-foot, in a station, 'Location' said not
  docked though".
2022-11-22 15:29:05 +00:00
Athanasius 876c34ecfd eddn: Remove two 'noqa: CCR001' that are no longer applicable 2022-11-22 14:09:08 +00:00