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

Add a Makefile for streamlined development and maintenance operations in OpenTofu Registry #1237

Closed
ipolyzos opened this issue Oct 31, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@ipolyzos
Copy link

ipolyzos commented Oct 31, 2024

Issue Description:

I'd like to propose adding a Makefile to the OpenTofu Registry project to improve development workflow, enhance build consistency, and streamline common operations. The Makefile will consolidate frequently used commands, making it easier for both new and experienced contributors to interact with the project by standardizing operations.

Motivation:

Including a Makefile can significantly improve the development experience by providing an accessible set of commands for common tasks, reducing the need to recall specific go commands or manually install dependencies. It will also help maintain consistency across contributors by promoting a standardized workflow, ensuring code quality and consistency.

Proposed Targets:

Below are the initial Makefile targets proposed for the registry project:

  • check-mkcert: Verify if mkcert is installed locally, a prerequisite for running a secure local environment.
  • create-certificate: Create a new local certificate if one does not already exist.
  • mod-init: Initialize go mod to handle dependencies.
  • populate-generated-folder: Populate the generated folder with required files for the registry.
  • run-server: Start the server, facilitating quick local development and testing.
  • build-all: Build all the binaries required for the registry.
  • test: Run tests for all packages to ensure code integrity and functionality.
  • clean: Remove generated files and binaries, maintaining a clean workspace.
  • fmt: Format Go code using Go’s formatting standards.
  • lint: Run static code analysis to maintain code quality.
  • vet: Analyze code to detect potential issues.
  • install-tools: Install required development tools to set up the environment.
  • help: Display available commands and their descriptions.

Expected Benefits:

  • Improved Developer Experience: A single command interface for common tasks simplifies the onboarding process for new contributors and minimizes setup and maintenance time.
  • Code Quality Assurance: Linting, vetting, and testing targets encourage a consistent code quality.
  • Enhanced Maintenance: Clear, standardized commands reduce the chance of errors and streamline project management.
@ipolyzos ipolyzos added the enhancement New feature or request label Oct 31, 2024
@abstractionfactory
Copy link
Contributor

Hi @ipolyzos I think the plan is to move to libregistry as it should incorporate the current shell script parts in Go. Certificates and such should not be needed as an external tool.

I would also like to note that Makefiles typically don't work on Windows and often times only work on Linux due to their reliance on shell scripting tools, so a more cross-platform tool would be in order if this is even needed.

@abstractionfactory abstractionfactory linked a pull request Nov 3, 2024 that will close this issue
@abstractionfactory
Copy link
Contributor

abstractionfactory commented Nov 5, 2024

Hey @ipolyzos we discussed this issue with the core team and we want to minimize the amount of shell scripts we have to maintain. The existing shell scripts are already causing a considerable amount of work and we would like to avoid adding more if possible.

Instead, we would be open to having a documentation on how to use and work with the registry, as well as setting up a fork of the registry. Would you be open to work on this?

@ipolyzos
Copy link
Author

ipolyzos commented Nov 5, 2024

Hi @abstractionfactory

Thank you for the feedback!

I understand the concerns about maintaining shell scripts, and I’m more than happy to help in any way that aligns with the team’s goals.

I would be happy to work on the suggested documentation for using the registry and setting up a fork.

Please let me know if there are specific areas or details you’d like covered, and I’ll make sure to incorporate those.

Looking forward to collaborating further!

@abstractionfactory
Copy link
Contributor

@ipolyzos the documentation should be in this repo and answer 3 main questions:

  1. How do I generate the registry dataset on my computer?
  2. How can I host an actual registry (Cloudflare R2, etc)
  3. How do I set up an automatic sync/update/submission process?

@abstractionfactory
Copy link
Contributor

Mirroring here what was said on #1248: We have discussed adding makefiles with the core team, and unfortunately, the amount of shell scripts we need to maintain is already causing issues (just now the registry sync was broken due to one). As a result, we decided not to accept any more non-critical shell scripts and we will be moving towards applications written in Go as they tend to be more robust.

If you would like to help making the registry more easily runnable, please help us by improving the contributor documentation or proposing a single entry point CLI for the registry, ideally in libregistry, not here.

@abstractionfactory abstractionfactory closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants