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

[FEATURE] Script to automate proper triggering of Docs Azure pipeline #3003

Merged
merged 90 commits into from
Jul 19, 2021

Conversation

cdkini
Copy link
Member

@cdkini cdkini commented Jul 8, 2021

Please annotate your PR title to describe what the PR does, then give a brief bulleted description of your PR below. PR titles should begin with [BUGFIX], [FEATURE], [DOCS], or [MAINTENANCE]. If a new feature introduces breaking changes for the Great Expectations API or configuration files, please also add [BREAKING]. You can read about the tags in our contributor checklist.

Changes proposed in this pull request:

  • Please see ticket for context: https://superconductive.atlassian.net/browse/GDOC-175
  • Script to determine what dependencies docs/ has on great_expectations/.
  • Implementation of this script in our Docs Azure YAML to dynamically determine when to run the pipeline.
  • Tests to cover the changes made.

After submitting your PR, CI checks will run and @tiny-tim-bot will check for your CLA signature.

For a PR with nontrivial changes, we review with both design-centric and code-centric lenses.

In a design review, we aim to ensure that the PR is consistent with our relationship to the open source community, with our software architecture and abstractions, and with our users' needs and expectations. That review often starts well before a PR, for example in github issues or slack, so please link to relevant conversations in notes below to help reviewers understand and approve your PR more quickly (e.g. closes #123).

Previous Design Review notes:

Definition of Done

Please delete options that are not relevant.

  • My code follows the Great Expectations style guide
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added unit tests where applicable and made sure that new and existing tests are passing.
  • I have run any local integration tests and made sure that nothing is broken.

Thank you for submitting!

@netlify
Copy link

netlify bot commented Jul 8, 2021

✔️ Deploy Preview for knoxpod ready!

🔨 Explore the source changes: 66bd06c

🔍 Inspect the deploy log: https://app.netlify.com/sites/knoxpod/deploys/60f5dfc7a37a6f0007a531f8

😎 Browse the preview: https://deploy-preview-3003--knoxpod.netlify.app

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2021

HOWDY! This is your friendly 🤖 CHANGELOG bot 🤖

Please don't forget to add a clear and succinct description of your change under the Develop header in docs/changelog.rst, if applicable. This will help us with the release process. See the Contribution checklist in the Great Expectations documentation for the type of labels to use!

Thank you!

Copy link
Contributor

@alexsherstinsky alexsherstinsky left a comment

Choose a reason for hiding this comment

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

@cdkini I left some more comments -- hope they are useful.

Copy link
Member Author

@cdkini cdkini left a comment

Choose a reason for hiding this comment

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

Made changes per our last discussion @alexsherstinsky please take a quick look whenever you have a minute.

I've left a comment or two but we should hopefully be good to have this merged in shortly!

scripts/trace_docs_deps.py Outdated Show resolved Hide resolved
Comment on lines 5 to 7

pip install -e . > /dev/null 2>&1 # Necessary to get GE helper methods working for `trace_docs_deps.py`

Copy link
Member Author

Choose a reason for hiding this comment

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

@alexsherstinsky we actually need to install GE if we want to use the file_relative_path() helper method in our dependencies script.

I don't think this is worth it as the remainder of script works as intended without any external dependencies.

Comment on lines 16 to 25
Please note that this solution has some inherit disclaimers one should be familiar with. As there is no actual running
of source code (but rather parsing of the source file's AST), it is hard to exactly pinpoint the location of a given
import. Utilizing the `__file__` attr would provide the exact path of an import but without that, we need to assume that
an ast.Import node corresponds to an accurate path in our codebase (i.e. `great_expectations.core.batch` results in
great_expectations/core/batch.py).

As long as imports correspond to the relative path of modules, this method will continue to work as intended. Deviations
here would result in certain imports not being picked up by the script, reducing the accuracy and frequency of the
Azure Docs Integration pipeline's triggers. As GE has maintained this consistency throughout its development, this
script and the methods used herein are deemed to be appropriate.
Copy link
Member Author

Choose a reason for hiding this comment

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

@alexsherstinsky added some color around possible pitfalls. Let me know if that's adequate or if I can better clarify anything.

for line in open(doc):
if re.search(pattern, line):
file: str = _parse_file_from_docusaurus_link(line)
path: str = file_relative_path(doc, file)
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this should be os.path.join(os.path.dirname(doc), file) (what file_relative_path is actually doing) so we can remove GE as a dependency from this script.

Copy link
Contributor

@alexsherstinsky alexsherstinsky left a comment

Choose a reason for hiding this comment

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

LGTM

@cdkini cdkini enabled auto-merge (squash) July 19, 2021 19:04
@cdkini cdkini disabled auto-merge July 19, 2021 19:10
@cdkini cdkini enabled auto-merge (squash) July 19, 2021 20:28
@cdkini cdkini merged commit c21da09 into develop Jul 19, 2021
@cdkini cdkini deleted the script-to-automate-azure-docs-triggers branch July 19, 2021 21:09
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.

None yet

3 participants