Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

Issue 763 central cli ops #764

Merged
merged 7 commits into from
Aug 23, 2019
Merged

Issue 763 central cli ops #764

merged 7 commits into from
Aug 23, 2019

Conversation

ggalmazor
Copy link
Contributor

@ggalmazor ggalmazor commented Jul 10, 2019

Closes #763

This PR adds new pull from Central and push to Central CLI operations.
This PR deprecates -url --aggregate_url (see below)

What has been done to verify that this works as intended?

Run both CLI operations using the all-widgets form and the Central sandbox at https://sandbox.central.opendatakit.org

Why is this the best possible solution? Were any other approaches considered?

This PR replicates the same things we already are doing for Aggregate server.

Instead of having shared args for things like the server's url and credentials, I considered having a separate set of args, but it felt bloated and not very reasonable overall.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

To be able to share args for the server's url and credentials, I had to review the language on their shortcode, longcode, and descriptions, and I found an irreconcilable issue with the -url --aggregate_url argument. I had to either change the longcode to --server_url or deprecate it and create a new arg. I opted for the latter, which means that users won't be able to continue using -url and will be prompted to use the new -U CLI arg.

Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below.

Yes! getodk/docs#1069

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PullFormFromCentral {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it still conventional to use nouns for classes? If so, how about CentralFormPuller?

Copy link
Contributor Author

@ggalmazor ggalmazor Aug 1, 2019

Choose a reason for hiding this comment

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

CentralFormPuller wouldn't be correct because this class statically describes a pull operation but it doesn't actually perform it (that's the JobsRunner's work).

I consider this class to be part of a group of domain operations (actions). The complete name would be PullFormFromCentralAction but it'd be longer with the Action suffix and feels redundant.

: response.isNotFound()
? "Error connecting to Central: Central not found"
: "Error connecting to Central");
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m starting to like this form of if/else if/…/else if/else. I prefer that the question mark abut the question, as in English, but I accept your style.

@kkrawczyk123
Copy link
Contributor

Tested with success!!
I have verified pllc with id, pllc without id, pllc with mhc and pshc I was also looking for regression in aggregate commands and I haven't found any !!
Verified on Ubuntu, MacOS and Windows.

@opendatakit-bot unlabel "needs testing"
@opendatakit-bot label "behavior verified"

@ggalmazor ggalmazor merged commit 59c7316 into getodk:master Aug 23, 2019
@ggalmazor ggalmazor deleted the issue_763_central_cli_ops branch August 23, 2019 10:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Central pull and push CLI ops
4 participants