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

SNOW-1643030 Append username template for v1.0 PDFs #1556

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

sfc-gh-fcampbell
Copy link
Collaborator

@sfc-gh-fcampbell sfc-gh-fcampbell commented Sep 10, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

When migrating v1.0 to v2.0, we need to emulate what the NativeAppProjectModel does when the app or package name are not specified, which is to append the USER env var to the generated identifier.

Comment on lines -171 to -177
# name: test_migrating_native_app_raises_error
'''
+- Error ----------------------------------------------------------------------+
| Your project file contains a native app definition. Conversion of Native |
| apps is not yet supported |
+------------------------------------------------------------------------------+

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just removed this unused snapshot

sfc-gh-gbloom
sfc-gh-gbloom previously approved these changes Sep 12, 2024
sfc-gh-pjafari
sfc-gh-pjafari previously approved these changes Sep 12, 2024
else:
# Backport the PackageV11 default name template, updated for PDFv2
package_identifier = _make_template(
f"fn.concat_ids('{native_app.name}', '_pkg_', fn.sanitize_id(fn.get_username('unknown_user')) | lower)"
Copy link
Contributor

@sfc-gh-cgorrie sfc-gh-cgorrie Sep 13, 2024

Choose a reason for hiding this comment

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

Nit: would be helpful to extract this naming logic out. Consider putting it near the original implementation (i.e. in api/project/util)

Copy link
Contributor

@sfc-gh-cgorrie sfc-gh-cgorrie left a comment

Choose a reason for hiding this comment

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

LGTM, one nitpick (it would be nice to extract out the template stanza somewhere as it's duplicated 3 times)

@sfc-gh-fcampbell sfc-gh-fcampbell merged commit 2f54589 into main Sep 16, 2024
19 checks passed
@sfc-gh-fcampbell sfc-gh-fcampbell deleted the frank-fix-migrate-username branch September 16, 2024 14:40
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.

5 participants