How to build an Alexa skill with multiple developers? - alexa

I'm struggling to handle the pipeline building an Alexa skill across several developers and existing docs just aren't cutting it.
We have four developers and when we check our code into our git repo, checkout new branches and so forth, we're continually overwriting our .ask/config and skill.json files.
How do we set this up to avoid overwriting? Ideally we're all building towards the same Alexa skill but we'd each like to test in our own instance -- separate skills and separate lambda functions.
As soon as I grab another developers branch, I lose my necessary config and skill files.
My gitignore has these files ignored, but since they're checked in they're continually being tracked.
How do I handle multiple developers?

I see several problems here.
First of all - clean up your repo: make sure that all developers have ./ask/* entry added to their .gitignore files and ./ask directory is removed from the origin.
To solve overriding problem - you can create a template-skill.json with placeholders for lambda's ARNs and all the other things different for each developer. Then, before ask deploy just create the valid skill.json file by running some script that replaces placeholders in the template JSON with your data (kept in another gitignored file).
Setup the same in your CI instance with configurations for different environments.

Related

What is the best way to add translation.json file to a React app running inside docke

I am working on a react web application, which may require multi language support. I am using i18n-next which internally loads the required configuration file from specific directory based on the language selected by user.
The word or scentences that needs to be translated may increase based the screens that user going to add and also if use adds new folder, we will loading those languages into our application.
What is the best way (I mean Scallable, Easy to configure, platform provided...) to satisfy the requirement?
( :( All I can think of is mounting an external locales folder to the folder inside container.. Is that the only way.. or something else is there..)
Note: kubernetes and rancher is there to manage. Plase provide solution/suggestion around that.
Nandri.
If you can add the files from the Storage bucket to Ci/CD & add files to the docker image and manage inside it that would be one way.
Following this way might be helpful during scaling up the application and need to manage the external locales folder and anything worried.
By external local folder mean you want to use the Host path of the node what if your node is changing by Kubernetes during maintenance how will you add the files to the node each time or manage it?
If you will use the PVC you might face the issue of readwriteonce if you are scaling the replicas you require the readwritemany. Make try to create stateless containers as much as possible.
If you can create and add the directory inside the docker image and directly use it that would be perfect or else you might could use the NFS like minio or glusterFS which support the readwritemany also.

Need to understand on Pipeline for the issue that i am facing

I am working on POC for my client to implement VSTS Pipelines for CICD.
While working on i have observed that my pipeline is picking all the components instead of one component.
Ex: I have 4 components and change was made only on one component, when i create a pull request for deployment to target org, ideally it should pick only the change which was modified, instead during deployment it is picking all the 4 components.
What's being deployed is controlled by the manifest file (package.xml). You specify what you're interested in, what you want to retrieve & deploy. Sometimes you can put wildcards in it (deploy all apex classes you can find), sometimes you really have to list stuff (standard objects, reports, email templates).
So out of the box deployment is always a complete package, whether files changed or not. It's bit overkill but on the other hand what are you going to sign-off in user acceptance test phase? Not just the tickets changed, the state of whole system including regression tests.
If you don't want that - you'd need a script that cherry-picks files changed from commit X to commit Y or something. There's been some attempts to do it, check answers to How to create Salesforce incremental package.xml automatically?
Next year (safe harbor blah blah blah) SF plans to release better DevOps tools: https://admin.salesforce.com/blog/2020/new-devops-center-is-awesome-for-admins

How to implement a tool to validate content and push it to the cloud

I am currently committing text files and images to a GitHub repository that need to have a certain format and content style, with validation done via pre-commit hooks, so all files committed to the repository are valid. I also need git to keep track of when files are updated and the versions that existed previously.
In the future I want to move to storing the files to a cloud service instead of the repository. This is the solution I though of:
Have a script that needs the directory you are trying to upload, name would need to be a certain format, ex. <City><Street>.
If it exists, the script compares the folder contents to the one in the cloud, if not all the folder gets uploaded.
Before upload we run content format validation, if it doesn't pass then we throw errors to the user.
If there were previous file versions, we store them in a different folder, appending the date/time to the filename.
Cloud now has the latest version.
I would lose a lot of the advantages that I had with version control and the pre-commit hooks before. I would gain the ability to just pull a specific folder, something that GitHub doesn't allow me to do. What would be a better way to implement this? Is there a tool that would be good for this?

How to update .env file and share among teammates?

I created .env file with params, pushed to github, my teammates downloaded repo. In next push I added .env file to .gitignore. Now I need to make changes to .env file, but how they will get it if .env ignored. What is the right way of doing such of manipulation?
UPDATE:
I used two libraries to manage env variables:
https://www.npmjs.com/package/dotenv
https://www.npmjs.com/package/config
You do not store configured .env file in repository but instead, you create .env.dist (or anything named like that) and commit that file. Your .dist file can contain all keys commented out, or all keys and default values. It's all up to you but you need to ensure your template do not contain any sensitive data too:
DB_HOST=
DB_USER=
The main benefit is that you do not have .env in the repo, so each developer can easily setup own system as he likes/needs (i.e. local db, etc) and there's no risk of having such file accidentally overwritten on next pull, which would be frustrating.
Also (again), you do not store any sensitive data in the repository, sowhile your .env.dist can and maybe even should be pre-configured to your defaults you must ensure any credentials are left empty, so noone can i.e. run the code against production machine (or figure out anything sensitive based on that file).
Depending on development environment you use, you can automate creation of .env file, using provided .env.dist as template (whcih useful i.e. with CI/CD servers). As dotenv file is pretty simple, processing it is easy. I wrote such helper tool for PHP myself, but it is pretty simple code and easily can be ported to any other language if needed. See process-dotenv on GitHub for reference.
Finally, if for any reason config setup is complicated in your project, you may want to create i.e. additional small script that can collect all data and write always up to date config file (or upgrade existing etc).

Meteor unwatch folder

I am trying to make a folder to be not watched. Is there a way to make one of the folders not watched in Meteor? I don't want my project to reload if I change a content in that folder.
Not exactly. Meteor assumes that if the folder content changes, it also needs to reload/restart the server, because the business logic of the application might have changed. Therefore it reloads these files and restarts the server
However, you might be able to "abuse" the tests/ directory or any of the directories/files mentioned below for that purpose. As explained in the Meteor guide on Application Structure, paragraph "Special directories":
Any directory named tests/ is not loaded anywhere. Use this for any test code you want to run using a test runner outside of Meteor’s built-in test tools.
The following directories are also not loaded as part of your app code:
Files/directories whose names start with a dot, like .meteor and .git
packages/: Used for local packages
cordova-build-override/: Used for advanced mobile build customizations
programs: For legacy reasons
So the reasonable choice would be to create a dot directory, e.g. .myStuff, and place anything that you might need to update but do not want to trigger a server restart there.
Just build your app in a package so you can decide which files you want to make available or not :)

Resources