Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source initialization order #96

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Conversation

adriansmares
Copy link
Contributor

@adriansmares adriansmares commented Oct 31, 2023

Summary

This PR fixes the fact that source commands are created after the sources are registered. This causes the flag set of the source to be empty.

Before:

go run ./cmd/ttn-lw-migrate chirpstack devices --help
Export devices by DevEUI

Usage:
  ttn-lw-migrate chirpstack device ... [flags]

Aliases:
  device, end-devices, end-device, devices, devs, dev, d

Flags:
  -h, --help   help for device

Global Flags:
      --dry-run                      Do everything except resetting root and session keys of exported devices
      --frequency-plans-url string   URL for fetching frequency plans (default "https://raw.githubusercontent.com/TheThingsNetwork/lorawan-frequency-plans/master")
      --verbose                      Verbose output

After:

go run ./cmd/ttn-lw-migrate chirpstack devices --help
Export devices by DevEUI

Usage:
  ttn-lw-migrate chirpstack device ... [flags]

Aliases:
  device, end-devices, end-device, devices, devs, dev, d

Flags:
      --api-ca string              (optional) CA for TLS
      --api-insecure               Do not connect to ChirpStack over TLS
      --api-token string           ChirpStack API Token
      --api-url string             ChirpStack API URL
      --export-session             Export device session keys from ChirpStack (default true)
      --export-vars                Export device variables from ChirpStack
      --frequency-plan-id string   Frequency Plan ID of exported devices
  -h, --help                       help for device
      --join-eui string            JoinEUI of exported devices

Global Flags:
      --dry-run                      Do everything except resetting root and session keys of exported devices
      --frequency-plans-url string   URL for fetching frequency plans (default "https://raw.githubusercontent.com/TheThingsNetwork/lorawan-frequency-plans/master")
      --verbose                      Verbose output

Changes

  • Register the sources next to the source commands.

Testing

Local testing - see above.

Regressions

N/A. This fixes a regression.

Notes for Reviewers

@KrishnaIyer please take a look.

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Documentation: Relevant documentation is added or updated.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.

@adriansmares adriansmares added this to the Oct 2023 milestone Oct 31, 2023
@adriansmares adriansmares self-assigned this Oct 31, 2023
Copy link
Member

@KrishnaIyer KrishnaIyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn

@adriansmares adriansmares marked this pull request as ready for review October 31, 2023 17:45
@adriansmares adriansmares merged commit 5cbc160 into master Oct 31, 2023
3 checks passed
@adriansmares adriansmares deleted the fix/cmd-registration branch October 31, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants