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

Repository initialization has hard assumptions #74

Open
BigGold1310 opened this issue Jun 17, 2024 · 0 comments · May be fixed by #75
Open

Repository initialization has hard assumptions #74

BigGold1310 opened this issue Jun 17, 2024 · 0 comments · May be fixed by #75
Labels
bug Something isn't working

Comments

@BigGold1310
Copy link

BigGold1310 commented Jun 17, 2024

What Happened?

I've cloned the repository and run ./init.sh my-cool-fn. The init.sh script is currently only changing the package names but not updating the Go module path. Updating the Go module path is essential for the package to function properly and to facilitate hosting on GitHub/GitLab.

Proposal

I expect the init.sh script to take the Go module path as its first argument. This will ensure that both the import paths and the Go module paths are updated correctly. To maintain compatibility with the example/* replacements, we can extract and use the last segment of the path as the package name.

  1. Clone or download the repository.
  2. Run ./init.sh github.com/my-fancy-org/my-cool-fn.
  3. Should update as following:
    1. go.mod gets updated to github.com/my-fancy-org/my-cool-fn.
    2. fn.go gets updated to github.com/my-fancy-org/my-cool-fn/input/v1beta1.
    3. Replace function-template-go with my-cool-fn

Steps to Reproduce

  1. Clone or download the repository.
  2. Run ./init.sh my-cool-fn.
  3. Verify the following:
    1. go.mod gets updated to github.com/crossplane/my-cool-fn.
    2. fn.go gets updated to github.com/crossplane/my-cool-fn/input/v1beta1.

Environment Details

  • Function version: main branch
@BigGold1310 BigGold1310 added the bug Something isn't working label Jun 17, 2024
@BigGold1310 BigGold1310 linked a pull request Jun 17, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant