gandi.cli icon indicating copy to clipboard operation
gandi.cli copied to clipboard

Migrate to v5

Open JulienPalard opened this issue 3 years ago • 6 comments

I was willing to only migrate the part interesting me, to keep it simple: domains. It went a bit further.

  • I dropped support for Python 2.6, 2.7, 3.3, 3.4, and 3.5, because 2021, f-strings, ...
  • Added Python 3.9 to travis-ci.
  • I dropped gandi record as it's deprecated since gandi dns, if I understand correctly.
  • I centralized the v5 mocks to avoid repetitive mocking.
  • I switched from nosetests to pytest in tox.

I presumed the dns.api.gandi.net was equivalent to api.gandi.net by not rewriting all the tests, just copying them, so this will probably need a good proofreading, or migrate the test to VCR to avoid having big JSONs in the code, and prooving they're right at the same time.

What I tested in my account, and works:

  • [x] gandi domain list
  • [x] gandi domain info $TEST_DOMAIN
  • [ ] gandi domain renew (warns about missing API KEY).
  • [x] gandi dns list $TEST_DOMAIN
  • [x] gandi dns list $TEST_DOMAIN www A
  • [x] gandi dns create $TEST_DOMAIN pouette TXT pouette
  • [x] gandi dns update $TEST_DOMAIN pouette TXT youpi
  • [x] gandi dns delete $TEST_DOMAIN pouette TXT
  • [x] gandi domain list --limit 1000 | while read -r domain; do if ! grep -q gandilivedns <(gandi domain info "$domain"); then echo "$domain"; fi; done

The last one was the one I was whishing to run in the first place when I searched for gandi on pypi. It works now, and my Gandi LiveDNS migration is 100% complète ♥

JulienPalard avatar Feb 12 '21 17:02 JulienPalard

Coverage Status

Coverage decreased (-0.8%) to 89.956% when pulling 814dd9e0a308e481cef8bedbada716194ef42a53 on JulienPalard:mdk/domain-v5 into bfe2e6f44135b7fbac50f9f44b5e58577583d07d on Gandi:master.

coveralls avatar Feb 12 '21 18:02 coveralls

I think it can be reviewed now. If I'm willing to do more, it'll probably be in another PR.

JulienPalard avatar Mar 02 '21 10:03 JulienPalard

@JulienPalard: Thank you for this, we really appreciate it but unfortunately we won't be able to maintain this as we have deprecated this CLI in its current form (see #313). We still plan to work on giving our API users a CLI but it won't be based on this repository. In the mean time, you are welcome to fork this project with your PR if you want. :) Thanks again!

yanndinendal avatar Aug 02 '21 16:08 yanndinendal

We still plan to work on giving our API users a CLI but it won't be based on this repository.

On which one? If still open-source?

JulienPalard avatar Aug 25 '21 15:08 JulienPalard

Hello @JulienPalard

No decision made currently, so there is no code that exists yet.

But Yes, when it will be done, there is no reason to have a closed source CLI for our public API.

mardiros avatar Sep 01 '21 09:09 mardiros

Can't this be merged?

drzraf avatar Jan 17 '22 20:01 drzraf