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

SqlServerDsc: Add markdown creation for public commands #1986

Merged

Conversation

johlju
Copy link
Member

@johlju johlju commented Dec 12, 2023

Pull Request (PR) description

  • SqlServerDsc
    • Added build tasks to generate Wiki documentation for public commands.
    • Documentation is now built using a separate meta task docs.
      It is run with the meta task pack which is run by the pipeline.
      To run the meta task docs the SMO assemblies must be loaded into the
      session, either by importing SqlServer module or loading SMO stubs.
    • QA test improved to speed up quality testing.

This PR is dependent on PR dsccommunity/DscResource.DocGenerator#133 being merged.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju changed the title F/add markdown creation for public commands SqlServerDsc: Add markdown creation for public commands Dec 12, 2023
@johlju
Copy link
Member Author

johlju commented Dec 12, 2023

TODO:

  • Make sure SqlServer that is added to RequiredModules.psd1 does not mess up integration tests
    • It does, another solution is needed, suggestions (went for option B):
      1. Use existing change and remove SqlServer module from folder RequiredModules before starting unit tests and integration tests job. But this will affect when run outside of pipeline - so not the best option

        Pros:

        • Utilization of existing changes: Using existing changes can be beneficial as it might not require additional resources or efforts.
        • Clean environment for testing: Removing the SqlServer module from the RequiredModules folder before starting unit tests and integration tests job can ensure a clean environment for testing.

        Cons:

        • Impact outside of pipeline: This approach will affect when run outside of the pipeline, which could potentially disrupt other processes or tasks.
        • Not the best option: There could be better alternatives available. This could mean that this approach might have other unidentified drawbacks.
      2. Use a separate pipeline job to build the docs by running documentation tasks, e.g. meta task docs. It will also make faster build times during development, but any problem with docs will only be know when running the meta task och running the pipeline. We also need to publish the build artifact after the pipeline job that generates the documentation. We need a meta task (Check_SqlServer_Availability) that checks that SqlServer module is available. The pipeline job can install it prior to running the meta task docs, but a user need to manually make it available, or load SMO stub types (only the SMO types is needed to generate the docs).

        Pros:

        • Faster build times during development: By using a separate pipeline job to build the docs, it can speed up the build times during the development process.
        • Automated documentation generation: The pipeline job can automatically run documentation tasks, such as the meta task docs, which can help in maintaining up-to-date documentation.

        Cons:

        • Delayed error detection: Any problem with the docs will only be known when running the meta task or running the pipeline, which could potentially delay the detection of issues.
        • Manual intervention for SqlServer module: If the SqlServer module is not available, a user needs to manually make it available, or load SMO stub types. This could be a potential inconvenience for the user.
  • Make sure to add a QA test to verify that script file of public command has a blank line at the top of the file
  • Clean up this PR when PR Add tasks to generate markdown for public commands DscResource.DocGenerator#133 is merged.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6e67e58) 94% compared to head (19e14f0) 94%.
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #1986   +/-   ##
====================================
  Coverage    94%     94%           
====================================
  Files        93      93           
  Lines      7844    7844           
====================================
  Hits       7424    7424           
  Misses      420     420           
Flag Coverage Δ
unit 94% <ø> (ø)

@johlju johlju force-pushed the f/add-markdown-creation-for-public-commands branch from a8e5207 to 4894c13 Compare December 31, 2023 20:47
@johlju johlju marked this pull request as ready for review December 31, 2023 22:48
@johlju johlju requested a review from a team as a code owner December 31, 2023 22:48
@johlju johlju added the needs review The pull request needs a code review. label Dec 31, 2023
@johlju johlju force-pushed the f/add-markdown-creation-for-public-commands branch from 68c9b10 to 594cae4 Compare January 14, 2024 14:34
@johlju
Copy link
Member Author

johlju commented Jan 15, 2024

I'm waiting for the PR to be merged and released in ModuleBuilder so we can revert commit f25ccd3, and modify commit b653037 so that it does not add the new QA test for checking if file starts with a new line.

@johlju johlju force-pushed the f/add-markdown-creation-for-public-commands branch from 594cae4 to b879bc2 Compare January 17, 2024 16:54
Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@johlju johlju merged commit a11aee3 into dsccommunity:main Jan 18, 2024
36 checks passed
@johlju johlju deleted the f/add-markdown-creation-for-public-commands branch January 18, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review The pull request needs a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SqlServerDsc: Automatically document public functions on build
1 participant