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

docs(core): docs for fingerprint are incorrect #26353

Merged
merged 3 commits into from
Jul 14, 2023

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Jul 13, 2023

This PR fixes a document for fingerprint in core module, because the caller's comments did not modify it.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jul 13, 2023

@aws-cdk-automation aws-cdk-automation requested a review from a team July 13, 2023 16:10
@github-actions github-actions bot added p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK labels Jul 13, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@go-to-k go-to-k changed the title Docs/core fingerprint docs(core): fingerprint Jul 13, 2023
Comment on lines 26 to 36
/**
* Produces fingerprint based on the contents of a single file or an entire directory tree.
*
* Line endings are converted from CRLF to LF.
*
* The fingerprint will also include:
* 1. An extra string if defined in `options.extra`.
* 2. The set of exclude patterns, if defined in `options.exclude`
* 3. The symlink follow mode value.
* 2. The symlink follow mode value.
*
* @param fileOrDirectory The directory or file to fingerprint
* @param options Fingerprinting options
Copy link
Contributor Author

@go-to-k go-to-k Jul 13, 2023

Choose a reason for hiding this comment

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

The correct doc is here.

/**
 * Produces fingerprint based on the contents of a single file or an entire directory tree.
 *
 * Line endings are converted from CRLF to LF.
 *
 * The fingerprint will also include:
 * 1. An extra string if defined in `options.extra`.
 * 2. The symlink follow mode value.
 *
 * @param fileOrDirectory The directory or file to fingerprint
 * @param options Fingerprinting options
 */
export function fingerprint(fileOrDirectory: string, options: FingerprintOptions = { }) {

Looking at the source codes, I think the fingerprint do not include the set of exclude patterns now.

  const ignoreMode = options.ignoreMode || IgnoreMode.GLOB;
  if (ignoreMode != IgnoreMode.GLOB) {
    _hashField(hash, 'options.ignoreMode', ignoreMode);
  }

  const ignoreStrategy = IgnoreStrategy.fromCopyOptions(options, fileOrDirectory);
  _processFileOrDirectory(fileOrDirectory, isDir);

  return hash.digest('hex');

  function _processFileOrDirectory(symbolicPath: string, isRootDir: boolean = false, realPath = symbolicPath) {
    if (!isRootDir && ignoreStrategy.ignores(symbolicPath)) {
      return;
    }

@aws-cdk-automation aws-cdk-automation dismissed their stale review July 13, 2023 16:15

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@go-to-k go-to-k changed the title docs(core): fingerprint docs(core): update docs for fingerprint Jul 13, 2023
@go-to-k go-to-k changed the title docs(core): update docs for fingerprint docs(core): update a doc for fingerprint Jul 13, 2023
@mrgrain mrgrain changed the title docs(core): update a doc for fingerprint docs(core): docs for fingerprint are incorrect Jul 14, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 02561de
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 97af59e into aws:main Jul 14, 2023
6 checks passed
@mergify
Copy link
Contributor

mergify bot commented Jul 14, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

colifran pushed a commit that referenced this pull request Jul 17, 2023
This PR fixes a document for `fingerprint` in `core` module, because the caller's comments did not modify it.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
bmoffatt pushed a commit to bmoffatt/aws-cdk that referenced this pull request Jul 29, 2023
This PR fixes a document for `fingerprint` in `core` module, because the caller's comments did not modify it.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants