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

Add examples from MongoDB Docs #7

Merged

Conversation

biniona-mongodb
Copy link
Contributor

@biniona-mongodb biniona-mongodb commented Sep 28, 2021

Add versioned examples from the Kafka IA-v2 docs set.

JIRA: https://jira.mongodb.org/browse/DOCSP-19236

@biniona-mongodb biniona-mongodb marked this pull request as ready for review September 28, 2021 14:35
@biniona-mongodb biniona-mongodb marked this pull request as draft September 28, 2021 16:55
@biniona-mongodb biniona-mongodb marked this pull request as ready for review October 25, 2021 15:12
@biniona-mongodb
Copy link
Contributor Author

biniona-mongodb commented Oct 25, 2021

PR Hints:

The areas I think deserve the most attention in this review are as follows:

Copy link
Contributor

@ccho-mongodb ccho-mongodb left a comment

Choose a reason for hiding this comment

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

First, this is this ticket, correct? https://jira.mongodb.org/browse/DOCSP-19236
I didn't see it linked in the description and am trying to get some context. Here are some questions that might steer any further feedback:

  1. Is this a repository that we're going to have documentation readers clone?
  2. Are we expecting them to run the build.py script or is that only for docs writers?
  3. I only looked at build.py, docs-examples/unsupported/README.md, and docs-examples/README.md as I wasn't able to decipher what "Fix issue where identical image names made it difficult to quickly switch between different examples" meant on Slack. Is there anything else I should take a look at?

@biniona-mongodb
Copy link
Contributor Author

biniona-mongodb commented Oct 26, 2021

Hi @ccho-mongodb, thanks for the feedback. I ran the code through pylint (should've done that before passing it off 🤦) and addressed feedback. The answers to the preceding questions are as follows:

  1. Yes, https://jira.mongodb.org/browse/DOCSP-19236 is the correct ticket. I've added it to the description.
  2. Yes, this is the repository docs readers will clone
  3. Yes, build.py is only for docs writers.
  4. No, I don't think there is anything else to take a look at.

Apologies for being unclear. What I meant by "Fix issue where identical image names made it difficult to quickly switch between different examples" relates to the following scenario:

  • Reader completes quickstart
  • Reader attempts to complete CDC example
  • Reader's Docker instance uses cached version of shell image as opposed to rebuilding activity specific shell, and reader experiences issue in example (such as jq not being included in environment).

By giving the images unique to an activity names specific to that activity, Docker rebuilds images that differ between examples when switching between examples without needing to prune images.

ccho-mongodb
ccho-mongodb previously approved these changes Oct 26, 2021
Copy link
Contributor

@ccho-mongodb ccho-mongodb left a comment

Choose a reason for hiding this comment

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

LGTM with a few comments and nitpicks.

I think you should not spend much time with fiddling with the build.py script. Eventually, we should probably replace it with a shell script or other mechanism to remove the unnecessary dependency on python.

@biniona-mongodb
Copy link
Contributor Author

biniona-mongodb commented Oct 27, 2021

Whoops looks like there is a setting on this repo that automatically dismisses reviews if a significant amount of the content changes after the review takes place. Apologies, you may have to leave another approving review @ccho-mongodb. I'll ask @RWaltersMA to disable this feature as it does not seem to be present on our other repos.

Copy link
Contributor

@ccho-mongodb ccho-mongodb left a comment

Choose a reason for hiding this comment

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

LGTM, left a couple comments. To reiterate my comment from before, we should spend a minimal amount of time/effort on the python script and the pseudo-template mechanism.

"v1.0": {IS_SUPPORTED:False, CONFLUENT_VERSION:None}
}

def recursively_find_replace(directory, find, replace, file_pattern):
'''Recursively find and replace a string in a directory.'''
'''Recursively searches directories for all occurrences of a string and replaces them.'''
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good, but the rest of the function comments don't follow the recommended form yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated remaining function doc-strings

Comment on lines 26 to 28
"v1.3": {IS_SUPPORTED:False, CONFLUENT_VERSION:"1.3.0"},
"v1.2": {IS_SUPPORTED:False, CONFLUENT_VERSION:"1.2.0"},
"v1.1": {IS_SUPPORTED:False, CONFLUENT_VERSION:"1.1.0"},
Copy link
Contributor

Choose a reason for hiding this comment

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

To reiterate my prior feedback, this isn't necessary because the info is not used. The dict you had originally just mapping named version to confluent version or None was fine and easier to understand (e.g. "v1.6": "1.6.1").

@biniona-mongodb biniona-mongodb merged commit 582ea2c into mongodb-university:main Oct 27, 2021
@biniona-mongodb biniona-mongodb deleted the add-docs-examples branch October 27, 2021 15:00
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