Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Documentation re-arrangement #65

Merged
merged 16 commits into from
Nov 24, 2017
Merged

Documentation re-arrangement #65

merged 16 commits into from
Nov 24, 2017

Conversation

Crim
Copy link
Contributor

@Crim Crim commented Nov 21, 2017

Looking at #19 one of the required changes is how we generate our docs. Currently the generator pulls in dependencies across what will become separate modules.

This PR moves the Doc generating logic out, and allows each "module" to call the generator passing in the bits it needs to build its documentation.

final String tagArg = "DYNAMIC_SPOUT_CONFIGURATION";
final List<ClassSpec> classSpecs = new ArrayList<>();
classSpecs.add(new ClassSpec(SpoutConfig.class, SpoutConfig.setDefaults(Maps.newHashMap())));
classSpecs.add(new ClassSpec(KafkaConsumerConfig.class));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

once KafkaConsumer bits get moved out to its own namespace, we'll create its own "DocTask" and remove it from being generated here.

@Crim Crim requested a review from stanlemon November 21, 2017 07:28
#!/bin/bash

## Build package
mvn package -DskipTests=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not turn this into a mvn goal or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea thought about that. We could call out to this, or add a bunch of goals for each config type, dunno which is better

Copy link
Contributor

Choose a reason for hiding this comment

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

I would do one goal in the root POM that takes a comma delimited list of classes or something like that. That way it's injected at that base POM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hooked this into the site goal. IE mvn clean site

Didn't feel like its worth running on every compile

/**
* Define a Class instance to generate documentation from.
*/
public class ClassSpec {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unnecessary to me. Why not just force the classes that we want to generate docs for to use an interface that includes a setDefaults/getDefaults method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just trying to change as little as possible for a first pass. I think we need to think about how/what things like SpoutConfig actually look like

Copy link
Contributor Author

Choose a reason for hiding this comment

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

^-- as part of a larger work item review those and come up with a plan

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I dig ya, I just feel like adding an interface that's like DefaultableConfig or something would be cleaner on the implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I think we need to come up with concrete config classes instead of maps, and add that as part of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to create a follow up issue to create concrete config classes for DynamicSpout, SidelineSpout (if needed), and KafkaConsumer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at adding an interface but currently we use static methods to setDefaults(). So before we could apply an interface over it, we'd first need to refactor SpoutConfig / SidelineConfig into being instantiated into an instance.

I think this is better pushed off to the specific issue/work around configs, see #80

@Crim
Copy link
Contributor Author

Crim commented Nov 24, 2017

So this isn't the 100% cleanest/DRY solution, but I think it satisfies what I was going for. Removing the cross-package pollution, with now adding hooks for generating metric docs.

The README as a whole needs an overhaul ( see #8 ) but we're in a better spot than we were before the PR. I also believe how we deal w/ Configs also needs some re-tooling ( #80 )

@Crim Crim merged commit bb2da79 into master Nov 24, 2017
@Crim Crim deleted the sp/doc branch November 24, 2017 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants