The test was initially not passing for me, I spent 2 hours:
Debugging my code and changing it.
Checking my .env.
Checking forum posts.
All the checks was a waste of time. My code was correct to begin with and I was investigating a red herring. The problem was resolved when I simply removed .env from .gitignore (which was in the boilerplate by the way).
The tutorial does not tell me to do that, so this was an incredibly frustrating experience. In fact, the tutorial told me that .env is a secret file. So logically I didn’t know I was supposed to commit it and push it to my repo. Yet this is the pass criteria for the test?
If I understand correctly, you are working on this project locally, and deploying to render.com. The deployment is possibly being done through Git (pushed changes cause a deployment)?
If so, this is expected behaviour. Any file in the .gitignore will not be tracked by Git.
That said, most projects I have ever worked on (over 100) have a .env file, and include it in the .gitignore, because this file is used for secrets that should not be pushed to a public repository.
You will encounter this in the following projects where you will be asked to add your database URI to the .env file, which, if you make public, someone can access your database.
Essentially, this boils down to the way you are hosting/deploying your project. This is case-specific. So, the instructions cannot include information for every single host/provider/workflow.
I assume render.com have a way to add secret/environment variables, and you will have to search how to do so in order to be able to pass.
If I understand correctly, you are working on this project locally, and deploying to render.com. The deployment is possibly being done through Git (pushed changes cause a deployment)?
If so, this is expected behaviour. Any file in the .gitignore will not be tracked by Git.
That said, most projects I have ever worked on (over 100) have a .env file, and include it in the .gitignore, because this file is used for secrets that should not be pushed to a public repository.
Yes that’s right and yep I know about that already. I had already pushed the .env file to the repo to pass the test. With your advice, I need to go back and check a more secure way with Render.com.
So, the instructions cannot include information for every single host/provider/workflow.
I understand what you’re saying. At the same time, surely we can do more to signpost the newbies? For example, the course could literally have one line that says ‘You may have to check secrets instructions with their provider to solve some of the challenges’ (but phrased better). This would’ve saved me time if I knew the right place to look in the first place.
You will encounter this in the following projects where you will be asked to add your database URI to the .env file, which, if you make public, someone can access your database.
Actually I am at this stage right now, so your reply came at the right time. As I mentioned, it would be even better if the student is informed ahead of time e.g. check with your provider about the secrets, .env vars.
To summarise: I want confidence that another fcc student doesn’t have to go through the same frustration as me. Constantly checking my code when nothing was wrong with my code to begin with.
The main thing we are trying to work with is:
a) Learners do not read - this is the first rule of web-design/tutorial-creation
b) We expect anyone who does not make use of the “simplified” setup (i.e. Replit) either already knows what they are doing, or will take the time to learn the specific tool they are using
For now, I suspect we will not be making major changes to this curriculum, because we are in the process of replacing it with a new version.
That said, adding a line like you suggested would not be a major change.
For now, I suspect we will not be making major changes to this curriculum, because we are in the process of replacing it with a new version.
Interesting, I was about to ask where is the suitable place to post suggestions if I feel the wording can be improved (or just any feedback to the current curriculum). But maybe I don’t need to do that, if there will be a new version in the future?
Otherwise, if you are in any way unsure of the suggestion, then here on the Contributors sub-forum works well.
If someone opened a pull request making that single line change, I would accept it. That said, we are very soon going to make changes to the introduction of that lesson, in preparation for the new curriculum. So, with this in mind, and probably an issue to track it, we can do it all together.