question stringlengths 11 28.2k | answer stringlengths 26 27.7k | tag stringclasses 130
values | question_id int64 935 78.4M | score int64 10 5.49k |
|---|---|---|---|---|
I have celery beat and celery (four workers) to do some processing steps in bulk. One of those tasks is roughly along the lines of, "for each X that hasn't had a Y created, create a Y."
The task is run periodically at a semi-rapid rate (10sec). The task completes very quickly. There are other tasks going on as well.
I'... | from functools import wraps
from celery import shared_task
def skip_if_running(f):
task_name = f'{f.__module__}.{f.__name__}'
@wraps(f)
def wrapped(self, *args, **kwargs):
workers = self.app.control.inspect().active()
for worker, tasks in workers.items():
for task in tasks:
... | RabbitMQ | 20,894,771 | 13 |
I have below versions of celery and rabbitmq installed -
celery 3.1.6
rabbitmq 3.1.1
I can post a task to the default queue from PHP -
//client.php
<?php
require 'celery-php/celery.php';
$c = new Celery('localhost', 'guest', 'guest', '/');
$result = $c->PostTask('tasks.add', array(2,2));
My worker module is in py... | By default, your PHP client for Celery takes the queue name as "celery".
In order to change the queue to publish to, you must specify the queue name while instantiating a connection to Celery.
So, if you are starting your Celery worker with "-Q demo" option, then your connection to Celery in PHP should be -
$exchang... | RabbitMQ | 20,655,367 | 13 |
I only created the last 2 queue names that show in Rabbitmq management Webui in the below table:
The rest of the table has hash-like queues, which I don't know:
1- Who created them? (I know it is celery, but which process, task,etc.)
2- Why they are created, and what they are created for?.
I can notice that when t... | When using celery, Rabbitmq is used as a default result backend, and also to store errors of failing
tasks(that raised exceptions).
Every new task creates a new queue on the server, with thousands of tasks the
broker may be overloaded with queues and this will affect performance
in negative ways.
Each queue in Rabbi... | RabbitMQ | 20,442,580 | 13 |
Is there a way to receive multiple message using a single synchronous call ?
When I know that there are N messages( N could be a small value less than 10) in the queue, then I should be able to do something like channel.basic_get(String queue, boolean autoAck , int numberofMsg ). I don't want to make multiple requests... | RabbitMQ's basic.get doesn't support multiple messages unfortunately as seen in the docs. The preferred method to retrieve multiple messages is to use basic.consume which will push the messages to the client avoiding multiple round trips. acks are asynchronous so your client won't be waiting for the server to respond. ... | RabbitMQ | 17,005,515 | 13 |
Perhaps I'm being silly asking the question but I need to wrap my head around the basic concepts before I do further work.
I am processing a few thousand RSS feeds, using multiple Celery worker nodes and a RabbitMQ node as the broker. The URL of each feed is being written as a message in the queue. A worker just reads ... | A single MQ message will certainly not be seen by multiple consumers in a normal working setup. You'll have to do some work for the cases involving failing/crashing workers, read up on auto-acks and message rejections, but the basic case is sound.
I don't see a synchronized queue (read: MQ) in the article you've linked... | RabbitMQ | 12,153,451 | 13 |
I have been trying to share connection between threads and have channels open only on thread creation but after researching a bit more, I think I want to also try to connection pooling. How can I do this on rabbitmq? or is this a general idea I can apply generally? My goal is to spawn X threads and then have them not... | All you need is a pool of Channel objects that your threads can pull from.
The Apache commons actually already has a generic ObjectPool you can use.
The javadoc for the interface can be found here: http://commons.apache.org/pool/api-1.6/org/apache/commons/pool/ObjectPool.html
The javadoc for one of their pre-built imp... | RabbitMQ | 10,365,867 | 13 |
Basically my consumers are producers as well. We get an initial dataset and it gets sent to the queue. A consumer takes an item and processes it, from that point there's 3 possibilities:
Data is good and gets putting a 'good' queue for storage
Data is bad and discarded
Data is not good(yet) or bad(yet) so data is b... | I think even if you could fix the issue of not sending duplicates to the queue, you will sooner or later hit this issue:
From RabbitMQ Documentation: "Recovery from failure: in the event that a client is disconnected from the broker owing to failure of the node to which the client was connected, if the client was a pu... | RabbitMQ | 10,155,114 | 13 |
I'm using celery with django and rabbitmq to create a message queue. I also have a worker, which is originating from a different machine. In a django view I'm starting a process like this:
def processtask(request, name):
args = ["ls", "-l"]
MyTask.delay(args)
return HttpResponse("Task set to execute.")
My task i... | If you look here you will find the following:
Django-celery uses MySQL to keep track of all tasks/results, rabbit-mq is used as a communication bus basically.
What really is happening is that you are trying to fetch the ASyncResult of the worker while the task is still running (the task invoked an HTTP request to your... | RabbitMQ | 9,576,160 | 13 |
Our company has a Python based web site and some Python based worker nodes which communicate via Django/Celery and RabbitMQ. I have a Java based application which needs to submit tasks to the Celery based workers. I can send jobs to RabbitMQ from Java just fine, but the Celery based workers are never picking up the job... | I found the solution. The Java library for RabbitMQ refers to exchanges/queues/routekeys. In Celery, the queue name is actually mapping to the exchange referred to in the Java library. By default, the queue for Celery is simply "celery". If your Django settings define a queue called "myqueue" using the following syntax... | RabbitMQ | 6,933,833 | 13 |
I am trying to get RabbitMQ with Celery and Django going on an EC2 instance to do some pretty basic background processing. I'm running rabbitmq-server 2.5.0 on a large EC2 instance.
I downloaded and installed the test client per the instructions here (at the very bottom of the page). I have been just letting the test... | Ok, I figured it out.
Here's the relevant piece of documentation:
http://readthedocs.org/docs/celery/latest/userguide/tasks.html#amqp-result-backend
Old results will not be cleaned automatically, so you must make sure to consume the results or else the number of queues will eventually go out of control. If you’re runn... | RabbitMQ | 6,362,829 | 13 |
I am currently running a docker-compose stack for basic integration tests with a protractor test runner, a nodejs server serving a web page and a wildfly server serving a java backend.
The stack is run from a dind(docker in docker) container in my build server(concourse ci).
But it appears that the containers does not ... | You can use these docker-compose parameters to achieve that:
--abort-on-container-exit Stops all containers if any container was
stopped.
--exit-code-from Return the exit code of the selected service
container.
For example, having this docker-compose.yml:
ve... | Concourse | 40,907,954 | 73 |
It's not clear for me from the documentation if it's even possible to pass one job's output to the another job (not from task to task, but from job to job).
I don't know if conceptually I'm doing the right thing, maybe it should be modeled differently in Concourse, but what I'm trying to achieve is having pipeline for ... | To answer your questions one by one.
All build state needs to be passed from job to job in the form of a resource which must be stored on some sort of external store.
It is necessary to store on some sort of external store. Each resource type handles this upload and download itself, so for your specific case I would ... | Concourse | 42,634,934 | 20 |
When I configure the following pipeline:
resources:
- name: my-image-src
type: git
source:
uri: https://github.com/concourse/static-golang
- name: my-image
type: docker-image
source:
repository: concourse/static-golang
username: {{username}}
password: {{password}}
jobs:
- name: "my-job"
plan:... | Every put implies a get of the version that was created. There are a few reasons for this:
The primary reason for this is so that the newly created resource can be used by later steps in the build plan. Without the get there is no way to introduce "new" resources during a build's execution, as they're all resolved to a... | Concourse | 38,964,299 | 13 |
I created a repository on hub.docker.com and now want to push my image to the Dockerhub using my credentials. I am wondering whether I have to use my username and password or whether I can create some kind of access token to push the docker image.
What I want to do is using the docker-image resource from Concourse to p... | In short, you can't. There are some solutions that may appeal to you, but it may ease your mind first to know there's a structural reason for this:
Resources are configured via their source and params, which are defined at the pipeline level (in your yml file). Any authentication information has to be defined there, be... | Concourse | 41,834,554 | 13 |
My goal is to be able to build, package and test a java project that is built with maven using a councourse build pipeline.
The setup as such is in place, and everything runs fine, but build times are much too long due to poor maven download rates from our nexus.
My build job yml file uses the following resource as bas... |
Assuming that your Nexus is local, I would look into why there are poor download rates from that, as using something like Nexus and Artifactory locally is currently the easiest way to do caching. They will manage the lifetime of your cached dependencies, so that you don't have dependencies being cached longer that the... | Concourse | 40,736,296 | 10 |
During Concourse build of Java application I want to:
Checkout git master branch
Run mvn package
If it was successful:
increment the SNAPSHOT version in Maven's pom.xml
commit it back to the master branch with [skip ci] commit message prefix
push local branch to the upstream
I haven't found the recommended way of ... | You should make your commit inside of a task.
You do that by making a task which has your repo as an input, and declares a modified repo as an output. After cloning from input to output, change into your output folder, make your changes and commit.
Here's an example pipeline.yml:
resources:
- name: some-repo
type: g... | Concourse | 42,607,033 | 10 |
I get the following error output while running the Maven release plugin prepare step i.e. mvn release:prepare --batch-mode -DreleaseVersion=1.1.2 -DdevelopmentVersion=1.2.0-SNAPSHOT -Dtag=v1.1.2 -X from an Atlassian Bamboo plan. However doing the same in the command line works fine. The full error stack is below.
Any i... | I ran into the same error on Jenkins in combination with maven release plugin, we fixed it by going to Additional behaviours, Check out to specific local branch and enter 'master'
I realise this is not a solution but it might give you some direction in where to look.
| Bamboo | 20,351,051 | 131 |
Anyone out there have experience with both Hudson and Bamboo? Any thoughts on the relative strengths and weaknesses of these products?
Okay, since folks keep mentioning other CI products I'll open this up further. Here are my general problem. I want to setup a CI system for a new project. This project will likely have... | Disclaimer: I work on Bamboo and therefore I am not going to comment on features of other CI products since my experience with them is limited.
To answer your specific requirements:
Handle multiple languages
Bamboo has out of the box support for multiple languages. Customers use it with Java, .Net, PHP, JavaScript e... | Bamboo | 4,806,331 | 117 |
I have a webapp build plan running on a Continuous Integration system (Atlassian Bamboo 2.5). I need to incorporate QUnit-based JavaScript unit tests into the build plan so that on each build, the Javascript tests would be run and Bamboo would interpret the test results.
Preferably I would like to be able to make the b... | As I managed to come up with a solution myself, I thought it would be a good idea to share it. The approach might not be flawless, but it's the first one that seemed to work. Feel free to post improvements and suggestions.
What I did in a nutshell:
Launch an instance of Xvfb, a virtual framebuffer
Using JsTestDriver:
... | Bamboo | 2,070,499 | 59 |
At my company, we currently use Atlassian Bamboo for our continuous integration tool. We currently use Java for all of our projects, so it works great.
However, we are considering using a Django + Python for one of our new applications. I was wondering if it is possible to use Bamboo for this.
First off, let me say t... | Bamboo essentially just runs a shell script, so this could just as easily be:
./manage.py test
as it typically is:
mvn clean install
or:
ant compile
You may have to massage to output of the Django test runner into traditional JUnit XML output, so that Bamboo can give you pretty graphs on how many tests passed. Look... | Bamboo | 1,419,629 | 37 |
I have SVN configured in Linux at a different location and I need to check-in a shell script to SVN with executable attribute ON from Windows. I use Bamboo as CI, which checks out sources from SVN and does the periodic build. It throws error that shell script is not executable. (Bamboo run as root).
What is the best wa... | svn propset svn:executable "*" someScript
The syntax is propset key value so svn:executable is the key and "*" is the value
someScript is the filename
| Bamboo | 6,874,085 | 33 |
I'm trying to tag the git repo of a ruby gem in a Bamboo build. I thought doing something like this in ruby would do the job
`git tag v#{current_version}`
`git push --tags`
But the problem is that the repo does not have the origin. somehow Bamboo is getting rid of the origin
Any clue?
| Yes, if you navigate to the job workspace, you will find that Bamboo does not do a straightforward git clone "under the hood", and the the remote is set to an internal file path.
Fortunately, Bamboo does store the original repository URL as ${bamboo.repository.git.repositoryUrl}, so all you need to do is set a remote p... | Bamboo | 27,371,629 | 28 |
Is it possible for TeamCity to integrate to JIRA like how Bamboo integrates to JIRA? I couldnt find any documentation on JetBrains website that talks about issue-tracker integration.
FYI: I heard that TeamCity is coming out with their own tracker called Charisma. Is that true?
| TeamCity 5 EAP has support for showing issues from Jira on the tabs of your build.
EAP Release Notes
you still don't have the integration in Jira itself which I would prefer
| Bamboo | 754,195 | 27 |
I'm in a process of writing a Bamboo plugin, the bulk of which is complete.
The plugin works by starting a remote process off via a post request to a server and then polling the same server until it gets a message saying the process has completed or an error occurred - this part works.
I would like to add some extra lo... | From reading what you had written, I think that using an event listener is definitely the correct way to approach your problem. Below I have provided an image of my own creation that seems to describe what you have constructed and that shows where it might be best to place the event listener.
Essentially, the client of... | Bamboo | 18,514,084 | 22 |
Is there a way to display all tests names in Bamboo, instead of only the names of the failed/fixed tests. When I browse to the tests section of the result page of the build, only the total number of tests is displayed, e.g. '30 tests in total'. What I actually want to see is a list of all tests performed.
| Go to your build results, choose the test tab and click on the small arrow on the left of the screen.
A navigator will show up.
Click on the job for which you want to see the test results and a list with all tests will show up in the right part of the screen.
| Bamboo | 9,211,999 | 16 |
I want to know if it is possible to configure something similar to what is accomplished by Jenkins+Github with the request builder plugin. Specifically, triggering a build on Bamboo when a pull request is created on Stash, using the pull request branch for the build.
Bonus points for triggering new builds when the pull... | We solved this by writing a Stash plugin, which has now been open sourced and is available on github.
The trick is to annotate methods with com.atlassian.event.api.EventListener, which will get Stash to call them when a corresponding event happens. Then just listen to events such as:
com.atlassian.stash.event.pull.Pul... | Bamboo | 17,581,061 | 16 |
We're running Atlassian's Bamboo build server 4.1.2 on a Windows machine. I've created a batch file that is executed within a Task. The script is just referenced in a .bat file an not inline in the task. (e.g. createimage.bat)
Within the createimage.bat, I'd like to use Bamboo's PLAN variables. The usual variable synta... | You are using the internal Bamboo variables syntax, but the Script Task passes those into the operating system's script environment and they need to be referenced with the respective syntax accordingly, e.g. (please note the underscores between terms):
Unix - goq-image-$bamboo_INTERNALVERSION-SB$bamboo_buildNumber
Win... | Bamboo | 12,196,936 | 15 |
My setup: git-repository on an Atlassian Stash-server and Atlassian Bamboo.
I'm using Maven 3.1.1 with the release-plugin 2.3.2. The plan in Bamboo looks like this:
Check out from git-repository
perform a clean install
perform release:prepare and release:perform with ignoreSnapshots=true and resume=false
Everything u... | mvn release:clean before release:prepare is what worked for me
| Bamboo | 20,213,557 | 14 |
Our CI server fails to restore our NuGet packages when attempting to build a project. It thinks they are already installed. Here are the logs:
build 16-Apr-2015 12:56:38 C:\build-dir\IOP-IOL-JOB1>nuget restore IOHandlerLibrary.sln -NoCache
build 16-Apr-2015 12:56:39 All packages listed in packages.config ar... | I had the same issue.
When I ran nuget restore for sln:
> nuget restore MySolution.sln
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files
(x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
When I ran the restore command individually for each project in solu... | Bamboo | 29,684,996 | 14 |
I've been looking at TFS, TeamCity, Jenkins and Bamboo and to be honest, none of them were convincing. I want
Good reporting
Good Git support
Gated/delayed check-in/commit
Integration with Visual Studio and/or Atlassian products
The solution shouldn't require regular developers to use command line or terminal (Git Ext... | @arex1337 All the answers here provided have their merits. Experience tells us no project/organization is ever happy with a single vendor for all their needs. What you may probably end up having is a base CI tool with a mix of plugins/additions from other vendors who their own USPs.
As an example :
Jenkins as a base ... | Bamboo | 12,155,401 | 13 |
Many of my project builds utilize the same stages, jobs and tasks over and over again. Is there any way to define a "template" plan and use it to make other templated plans from? I'm not talking about cloning, because with cloning, you are then able to make independent changes to all the clones.
What I want is a way to... | That isn't currently possible, unfortunately:
A fairly old feature request for plan templates to reuse across projects (BAM-907) has been resolved as Fixed due to the introduction of plan branches in Bamboo 4.0 (see Using plan branches for details):
Plan Branches are a Bamboo Plan configuration that represent a branch... | Bamboo | 23,083,779 | 13 |
I just installed nodejs on one of my build servers (Win Server 2008 R2) which hosts a Bamboo remote agent. After completing the installation and doing a reboot I got stuck in the following situation:
The remote Bamboo build agent is running as a windows service with user MyDomain\MyUser. When a build with an inline pow... | If you do a default installation of nodejs you will see that it adds nodejs and npm to the path. Sometimes I have seen that the installer adds a user variable named PATH - it might be that the Bamboo agent decides to read the user path without "merging" it with the system path. I think it would be worth a try to give t... | Bamboo | 30,183,168 | 12 |
We use Bamboo CI. There are multiple bamboo local agents and parallel builds across many plans. The build-dir in bamboo-home is many hundreds of gigabytes, and analysis shows that it just continually grows as new feature branches are added. Plans seem to be duplicated in each local agent directory, and also directly in... | The cron job has been running for a while now without any issues, and it is keeping the space usage under control.
I have reduced the parameter to 15 days.
My crontab looks like this:
# clean up old files from working directory
0 20 * * * find /<path_to>/bamboo-home/xml-data/build-dir/ -depth -not -path *repositories-c... | Bamboo | 35,444,951 | 12 |
i am new to this continuous integration tool..named Bamboo .. could someone point me to the right direction where i can get information about how to setup this bamboo .. how to write scripts for automatic deployment for different environments... thank you in advance....
| You will use your ant script or Mavn pom.xml to deploy and bamboo will scheduled it.
You will find a getting start tutorial here with a guide that shows you how to install Bamboo (really easy): https://confluence.atlassian.com/bamboo/bamboo-installation-guide-289276785.html
| Bamboo | 1,403,309 | 11 |
I am trying to access Bamboo's variables as environment variables in my build script (PowerShell).
For example, this works fine in TeamCity
$buildNumber = "$env:BUILD_NUMBER"
And I expected this to work in Bamboo
$buildNumber = "$env:bamboo_buildNumber"
| In the current version of Bamboo (5.x), the following environment variables work for me in Bash on an Amazon EC2 Linux client within a Bash script. It should be very similar in PowerShell.
${bamboo.buildKey} -- The job key for the current job, in the form PROJECT-PLAN-JOB, e.g. BAM-MAIN-JOBX
${bamboo.buildResultsUrl} ... | Bamboo | 15,987,684 | 11 |
We are using Bamboo 5.2 for continuous integration.
Source plan has several additional branches. Each branch is triggered by commits in git repo.
Deployment project is configured with separate environment for each branch, deployment happens automatically on successful build of source plan.
When default branch is deploy... | In Bamboo 6.1.0 Atlassian has solved the problem!
Please see https://jira.atlassian.com/browse/BAM-14422.
Since now on naming for releases created on non-default branches follow defined naming rules.
| Bamboo | 20,760,542 | 11 |
This seemed like a good idea at the time
public static final String MY_CONFIG_FILE = System.getenv("APP_HOME")
+ "/cfg/app.properties";
When pushed code to Bamboo some tests failed with
java.io.FileNotFoundException: ./cfg/app.properties (No such file or directory)
I di... | In case someone is interested, in order to reference current working directory, APP_HOME should be set to:
APP_HOME=${bamboo.build.working.directory}
| Bamboo | 10,417,486 | 10 |
I have a bamboo build with 2 stages: Build&Test and Publish. The way bamboo works, if Build&Test fails, Publish is not run. This is usually the way that I want things.
However, sometimes, Build&Test will fail, but I still want Publish to run. Typically, this is a manual process where even though there is a failing ... | From the Atlassian help forum, here:
https://answers.atlassian.com/questions/52863/how-do-i-run-just-a-single-stage-of-a-build
Short answer: no. If you want to run a stage, all prior stages have to finish successfully, sorry.
What you could do is to use the Quarantine functionality, but that involves re-running the fa... | Bamboo | 10,459,130 | 10 |
While building a single page app with AngularJS, I'm trying to integrate Jasmine tests in my build.
I did something similar before with the Maven Jasmine plugin, but I don't like to wrap my project in maven just to run the Jasmine tests. It seems cleaner to use Karma (was Testacular) for this somehow.
I'm comfortable t... | Great question. Make sure testacular.conf.js is configured to output junit xml for consumption by bamboo
junitReporter = {
// will be resolved to basePath (in the same way as files/exclude patterns)
outputFile: 'test-results.xml'
};
You can configure Testacular to run against many browsers and is pre-configured to... | Bamboo | 13,134,463 | 10 |
During build with Bamboo we creating file /var/atlassian/bamboo/xml-data/build-dir/T4-TGDP-RD/release/dev_patch_release.tar.bz2. This file exist, checked it with command line.
At 'Artifact definitions' I have following pattern: **/release/*.bz2.
But unfortunately after build is done, in Bamboo -> Build -> Artifact No a... | In artifact definition screen:
For Location specify a relative path to the files you want to create artifact
For Copy pattern, specify the pattern to be copied.
For you case, put ./release into the Location box, then specify *.bz2 as a copy pattern.
For more info, see this issue https://jira.atlassian.com/browse/BAM-... | Bamboo | 23,544,905 | 10 |
I've got a branched build in Bamboo which is configured to delete builds after 14 days.
Usually branches aren't inactive that long in our project, however with Christmas leave and some early New Year priorities one branch has been inactive for more than 14 days. As a result it has dropped out of the branched build list... | Have a look at this post:
Deleted plans are not remade when code is pushed to existing branch.
Go to Plan Configuration -> Branches, and click button in upper-right to manually add a branch.
From branch add modal, select desired branch and check box for 'Enable branches'.
(optional) on following screen for new plan b... | Bamboo | 34,867,230 | 10 |
I have a PowerShell script which I intend to use as a deployment step in Bamboo. Opening PowerShell and running the script with ./script.ps1 works fine, but using powershell.exe -command ./script.ps1 fails with error Unable to find type [Microsoft.PowerShell.Commands.WebRequestMethod].
What is the difference between ru... | I guess it can be an issue with PowerShell.exe itself, I can reproduce the issue in PowerShell 2.0, 3.0, 4.0 and 5.0.
It's an issue that you can't use type constraint of namespace Microsoft.PowerShell.Commands if you don't run any other command first when you are running your script by using PowerShell.exe
I found two ... | Bamboo | 49,852,915 | 10 |
I updated the gradle plugin to the latest version : com.android.tools.build:gradle:3.0.0-alpha1 and this error occured in AS:
export TERM="dumb"
if [ -e ./gradlew ]; then ./gradlew test;else gradle test;fi
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'Andr... | Google have new maven repo
https://android-developers.googleblog.com/2017/10/android-studio-30.html > section Google's Maven Repository
https://developer.android.com/studio/preview/features/new-android-plugin-migration.html
https://developer.android.com/studio/build/dependencies.html#google-maven
So add the dependency ... | CircleCI | 44,071,080 | 176 |
Is it possible to install npm package only if it has not been already installed?
I need this to speed up test on CircleCI, but when I run npm install protractor@2.1.0 etc. it always downloads things and installs them from scracth, however, node_modules folder with all modules is already present at the moment of running... | You could try npm list protractor || npm install protractor@2.1.0
Where npm list protractor is used to find protractor package.
If the package is not found, it will return npm ERR! code 1 and do npm install protractor@2.1.0 for installation
| CircleCI | 30,667,239 | 56 |
I am trying to integrate my springboot tutorial project with CircleCi.
My project is inside a subdirectory inside a Github repository and I get the following error from CircleCi.
Goal requires a project to execute but there is no POM in this
directory (/home/circleci/recipe). Please verify you invoked Maven
from ... | I managed to fix the issue. I believe the combination of
working_directory: ~/spring-tutorial/recipe
and of
- checkout:
path: ~/spring-tutorial
made it work.
Here is my working config.yml:
# Java Maven CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more detail... | CircleCI | 50,570,221 | 47 |
My iOS certificate is stored in GitHub and it is expired, the failure message in circleci progress is that ‘Your certificate 'xxxxxxx.cer' is not valid, please check end date and renew it if necessary’.
Do I need to create a new certificate, or download an existing one? I don’t remember how this was originally created... | You can use fastlane match development after deleting the development profiles and certificates from your git repo. Alternatively, you can delete everything from git repo and run fastlane match
If you do not care about existing profiles and certificates, just run fastlane match nuke development and fastlane match nuke ... | CircleCI | 56,179,677 | 43 |
I have tested with my React-app in typescript, using ts-jest like below.
import * as React from "react";
import * as renderer from "react-test-renderer";
import { ChartTitle } from "Components/chart_title";
describe("Component: ChartTitle", () => {
it("will be rendered with no error", () => {
const chartTitle =... | tsconfig-paths-jest is not usable in Jest >23. For current Jest 26 I got it working via: https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping/
jest.config.js
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig');
module.exports = {
preset: 'ts-j... | CircleCI | 55,488,882 | 41 |
I'm trying to build my android project using gradle and circleCI, but I've got this error :
* What went wrong:
A problem occurred configuring root project '<myproject>'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.2.3.
Searched in the follo... | It seems the current versions of the Android Gradle plugin are not added to Maven Central, but they are present on jcenter. Add jcenter() to your list of repositories and Gradle should find version 2.2.3. On Maven Central the newest available version is 2.1.3: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.andr... | CircleCI | 41,570,435 | 40 |
I want to use CircleCI just to push my docker image to Dockerhub when I merge with master. I am using CircleCI in other projects where it is more useful and want to be consistent (as well as I am planning to add tests later). However all my builds fail because CircleCI says: "NO TESTS!", which is true. How can I disabl... | I solved the problem by overriding the test section of circle.yml:
test:
override:
- echo "test"
This works for CircleCI 1.0
| CircleCI | 35,304,343 | 30 |
I have a circle.yml file like so:
dependencies:
override:
- meteor || curl https://install.meteor.com | /bin/sh
deployment:
production:
branch: "master"
commands:
- ./deploy.sh
When I push to Github, I get the error:
/home/ubuntu/myproject/deploy.sh returned exit code 126
bash: line 1: /home/ub... | Several possible problems:
deploy.sh might not be marked as executable (chmod +x deploy.sh would fix this)
The first line of deploy.sh might not be a runnable shell...
If the first doesn't work, can we please see the contents of deploy.sh?
| CircleCI | 33,942,926 | 29 |
I've upgraded a project to Go 1.11 and enabled module support for my project, but it seems that CircleCI is re-downloading the dependencies on every build. I know CircleCI allows caching between rebuilds, so I've looked at the documentation for Go modules, and while it mentions a cache, I can't seem to find where it ac... | As of the final 1.11 release, the go module cache (used for storing downloaded modules and source code), is in the $GOPATH/pkg/mod location (see the docs here). For clarification, the go build cache (used for storing recent compilation results) is in a different location.
This article, indicated that it's in the $GOPAT... | CircleCI | 52,082,783 | 22 |
When executing a build for git repository giantswarm/docs-content in CircleCI, I'd like to push a commit to another repository giantswarm/docs.
I have this in the deployment section of circle.yml:
git config credential.helper cache
git config user.email "<some verified email>"
git config user.name "Github Bot"
git clon... | I've used
git push -q https://${GITHUB_PERSONAL_TOKEN}@github.com/<user>/<repo>.git master
and it worked.
Update it to be:
# Push changes
git config credential.helper 'cache --timeout=120'
git config user.email "<email>"
git config user.name "<user-name>"
git add .
git commit -m "Update via CircleCI"
# Push quietly t... | CircleCI | 44,773,415 | 20 |
In my Django application I have a circle.yml file that runs 'pip install -r requirements/base.txt'. When I push up code, and check the CircleCI logs when there is an error, its hard to get to because there are so many dependencies and as of pip6 they started showing progress bars for the installations. Because of that ... | That PR was merged and is available on the latest stable build (pip 10.0.1 at the time of writing). Just do:
pip install foo --progress-bar off
Other args are available. See the pip install docs.
| CircleCI | 48,429,265 | 19 |
So the background is this: I have an Xcode project that depends on a swift package that's in a private repository on github. Of course, this requires a key to access. So far, I've managed to configure CI such that I can ssh into the instance and git clone the required repository for the swift package. Unfortunately whe... | For CI pipelines where you cannot sign into GitHub or other repository hosts this is the solution I found that bypasses the restrictions/bugs of Xcode around private Swift packages.
Use https urls for the private dependencies because the ssh config is currently ignored by xcodebuild even though the documentation says o... | CircleCI | 59,035,529 | 19 |
Currently, rake db:schema:load is run to setup the database on CircleCI. In migrating from using schema.rb to structure.sql, the command has been updated to: rake db:structure:load.
Unfortunately, it appears to hang and does not return:
$ bin/rake db:structure:load --trace
** Invoke db:structure:load (first_time)
** In... | This seems to have something to do with the psql client's output to the terminal expecting user input:
set_config
------------
(1 row)
(END) <--- like from a terminal pager
Not exactly a proper solution, but a workaround in .circleci/config.yml:
jobs:
build:
docker:
- image: MY_APP_IMAGE
... | CircleCI | 53,055,044 | 18 |
I am trying to integrate CircleCi with gcloud Kubernetes engine.
I created a service account with Kubernetes Engine Developer and Storage Admin roles.
Created CircleCi yaml file and configured CI.
Part of my yaml file includes:
docker:
- image: google/cloud-sdk
environment:
- PROJECT_N... | This is an old thread, this is how this issue handled today in case using cloud build :
Granting Cloud Build access to GKE
To deploy the application in your Kubernetes cluster, Cloud Build needs the Kubernetes Engine Developer Identity and Access Management Role.
Get Project Number:
PROJECT_NUMBER="$(gcloud projects de... | CircleCI | 53,420,870 | 17 |
We keep getting the following exception on CircleCI while building out project. Everything runs well when running the job from the CircleCI CLI. Has anyone found a fix / resolution for this?
Compilation with Kotlin compile daemon was not successful
java.rmi.UnmarshalException: Error unmarshaling return header; nested e... | This configuration got rid of the issue:
Changing from JVM_OPTS: -Xmx3200m to JVM_OPTS: -Xmx2048m was important
version: 2
executors:
my-executor:
docker:
- image: circleci/android:api-28-node
working_directory: ~/code
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDum... | CircleCI | 55,939,204 | 17 |
I am looking for a way via GitHub (or CircleCI) settings to prevent the person who opens or commits to a pull request from being able to merge or approve that pull request.
So far I have the protection of a branch that requires approvals but post-approval I as PR creator and committer I still able to merge.
| You need to be able to
prevent the person that is involved in PR (create PR or make a commit) to be able to merge PR (or even approve it)
A contributor who has created a PR cannot approve or request changes by default in GitHub, so that is already taken care of.
Since a Pull Request is a GitHub feature, a PR merge ca... | CircleCI | 62,601,595 | 17 |
Are there any cloud CI services that allow Vagrant VMs to run using VirtualBox as a provider?
Early investigation shows this seems not to be possible with Travis CI or Circle CI, although the vagrant-aws plugin allows for the use of AWS servers as a Vagrant provider. Is this correct?
| Update January 2021: GitHub Actions also supports Vagrant - and Vagrant/VirtualBox are both installed out-of-the-box in the MacOS environment (not on Linux or Windows currently!). See the possible environments here. Therefore I created a fully comprehensible example project at: https://github.com/jonashackt/vagrant-git... | CircleCI | 31,828,555 | 16 |
Config:
CircleCI 2.0
Bitbucket private repo
After I click on "Rebuild with SSH", the "Enable SSH" section outputs
Failed to enable SSH
No SSH key is found. Please make sure you've
added at least one SSH key in your VCS account.
What does this mean? How do I fix this?
| You can use your personal private public id_rsa id_rsa.pub key-pair (which you may already generated to SSH access to other machines)
just add your public key ~./ssh/id_rsa.pub to Bitbucket -> Settings -> SSH keys -> add SSH key
then go to CircleCI and rebuild the project.
There may be confusion because CircleCi uses ... | CircleCI | 46,047,337 | 16 |
I have the following code (see the comments for what's happening):
// Clone repository from GitHub into a local directory.
Git git = Git.cloneRepository()
.setBranch("gh-pages")
.setURI("https://github.com/RAnders00/KayonDoc.git")
.setDirectory(new File("/home/ubuntu/KayonDoc"))
... | Looks like you have defined
URL Rewriting
Git provides a way to rewrite URLs with the following config:
git config --global url."git://".insteadOf https://
To verify if you have set it check the configuration of your repository:
git config --list
You'll see the following line in the output:
url.git://.insteadof=https... | CircleCI | 33,835,669 | 15 |
Im running some tests in circleci and some of the tests are taking longer then 10 min cause its ui tests that run on a headless browser that Im installing in my circle.yml
How can I extend the time of the timeout?
thanks
| You can add the timeout modifier to your command to increase the timeout beyond the default 600 seconds (10min).
For example, if you ran a test called my-test.sh, you could do the following:
test:
override:
- ./my-test.sh:
timeout: 900
Note that the command ends with a colon (:), with the modifier on the... | CircleCI | 36,173,553 | 15 |
I am stuck in this problem. I am running cypress tests. When I run locally, it runs smoothly. when I run in circleCI, it throws error after some execution.
Here is what i am getting:
[334:1020/170552.614728:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No ... | Issue resolved by reverting back cypress version to 7.6.0.
| CircleCI | 69,658,152 | 15 |
I have a spec for a method that returns a timestamp of an ActiveRecord object.
The spec passes locally, but whenever it is run on CircleCI, there is a slight mismatch between the expected and the actual.
The spec looks something like this:
describe '#my_method' do
it 'returns created_at' do
object = FactoryGirl.c... | I am encountering the same issue and currently have an open ticket with CircleCI to get more information. I'll update this answer when I know more.
In the meantime, a workaround to get these tests passing is just to ensure that the timestamp you're working with in a test like this is rounded using a library that mocks ... | CircleCI | 30,139,038 | 14 |
I have some questions and issues with my CI and CD solution.
Rails: 4.2
Capistrano: 3.4.0
The application is hosted on a private server.
Right now I have the workflow working with deploying development, staging and production via the terminal.
I also hooked up Circle CI working good on these branches.
I cannot find how... | Use SSH keys for authentication. You might as well use it for your own SSH sessions too, because it's more convenient and secure (a rare occasion!) than password authentication. Check out this tutorial on how to set it up.
Then, paste your private key to CircleCI in Project Settings -> SSH Permissions, as described her... | CircleCI | 32,467,128 | 14 |
I have created spec/lint/rubocop_spec.rb which runs Rubocop style checker on the files changed between current branch and master. This works when I test locally but not when the test run on the build server Circle.ci.
I suspect it is because only the branch in question is downloaded, so it does not find any differences... | You don't have to use github api, or even ruby (unless you want to wrap the responses) you can just run:
git fetch && git diff-tree -r --no-commit-id --name-only master@\{u\} head | xargs ls -1 2>/dev/null | xargs rubocop --force-exclusion
see http://www.red56.uk/2017/03/26/running-rubocop-on-changed-files/ for longer... | CircleCI | 32,553,877 | 14 |
When building the app on CircleCI for v0.59.x it gives me the following error (It used to work fine till v0.57.8):
[12:45:19]: ▸ Note: Some input files use or override a deprecated API.
[12:45:19]: ▸ Note: Recompile with -Xlint:deprecation for details.
[12:45:19]: ▸ > Task :react-native-svg:processReleaseJavaRes NO-SOU... | One of the reasons could be the number of workers the Metro bundler is using.
Setting maxWorkers: <# workers> in metro.config.js fixed it for me:
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
... | CircleCI | 56,002,938 | 14 |
I would like to programmatically determine if a particular Python script is run a testing environment such as
GitHub action
Travis CI
Circle CI
etc. I realize that this will require some heuristics, but that's good enough for me. Are certain environment variables always set? Is the user name always the same? Etc.
| An environment variable is generally set for each CI/CD pipeline tool.
The ones I know about:
os.getenv("GITHUB_ACTIONS")
os.getenv("TRAVIS")
os.getenv("CIRCLECI")
os.getenv("GITLAB_CI")
Will return true in a python script when executed in the respective tool environment.
e.g:
os.getenv("GITHUB_ACTIONS") == "true" in... | CircleCI | 73,973,332 | 14 |
I currently have a few services such as db and web in a django application, and docker-compose is used to string them together.
The web version has code like this..
web:
restart: always
build: ./web
expose:
- "8000"
The docker file in web has python2.7-onbuild, so it uses the requirements.txt file to install... | Yes, using docker-compose in the circle.yml file can be a nice way to run tests because it can mirror ones dev environment very closely. This is a extract from our working tests on a AngularJS project:
---
machine:
services:
- docker
dependencies:
override:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER ... | CircleCI | 31,787,426 | 13 |
Excerpt from a CircleCI config file:
deploy:
machine:
enabled: true
steps:
- run:
name: AWS EC2 deploy
command: |
ssh -o "StrictHostKeyChecking no" ubuntu@xxx.xxx.xxx.xxx "cd ~/circleci-aws; git pull; npm i; npm run build; pm2 restart build/server
How can I break the command into ... | This is an old one, but it's had a lot of views so what I've found seems worth sharing.
In the CircleCI docs (https://circleci.com/docs/2.0/configuration-reference/#shorthand-syntax) they indicate that in using the run shorthand syntax you can also do multi-line.
That would look like the following
- run: |
git add ... | CircleCI | 51,672,067 | 13 |
I'm getting deprecation warning from my pipelines at circleci.
Message.
/home/circleci/evobench/env/lib/python3.7/site-packages/_pytest/junitxml.py:436: PytestDeprecationWarning: The 'junit_family' default value will change to 'xunit2' in pytest 6.0.
Command
- run:
name: Tests
command: |
. env/bin/activa... | Run your command in this ways.
with xunit2
python -m pytest -o junit_family=xunit2 --junitxml=test-reports/junit.xml
with xunit1
python -m pytest -o junit_family=xunit1 --junitxml=test-reports/junit.xml or
python -m pytest -o junit_family=legacy --junitxml=test-reports/junit.xml
This here describes the change in detai... | CircleCI | 60,212,552 | 13 |
Is there a way to restrict circleci deployment on checkings that have a specific git tag?
Currently I am using this
...
deployment:
dockerhub:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push abcdef
Instead of branch: master I would like to w... | It looks like this was added since Kim answered.
Normally, pushing a tag will not run a build. If there is a deployment configuration with a tag property that matches the name of the tag you created, we will run the build and the deployment section that matches.
In the below example, pushing a tag named release-v1.05 ... | CircleCI | 30,817,760 | 12 |
I maintain an open-source framework that uses CircleCI for continuous integration. I've recently hit a wall where the project suddenly refused to build in rather strange circumstances.
Build 27 was the last one that succeeded. After that, I made some minor changes to dependencies and noticed that the build fails. I've ... | It seems to be an issue with gcc-4.9.2. I forked your project, started a build with high verbosity level, connected to the circleci container and run the exact linking command. It fails the same way:
ubuntu@box1305:~$ /usr/bin/gcc -fno-stack-protector -DTABLES_NEXT_TO_CODE '-Wl,--hash-size=31' -Wl,--reduce-memory-overh... | CircleCI | 34,654,262 | 12 |
I'm trying to build a react app on CircleCI which until recently I've had no issues with. I'm now getting the following error whenever I attempt an npm run build from my circle.yml:
#!/bin/bash -eo pipefail
npm run build
> jobcatcher-web@0.0.1 build /home/circleci/repo
> react-scripts build
/home/circleci/repo/no... | Turns out I'd been importing environmental variables using the same name e.g. REACT_APP_API_KEY_GOOGLE_MAPS=${REACT_APP_API_KEY_GOOGLE_MAPS} .
Once I changed the name e.g.
REACT_APP_API_KEY_GOOGLE_MAPS=${REACT_APP_API_KEY_GOOGLE_MAPS_EXT}
this issue was resolved!
| CircleCI | 49,287,598 | 12 |
I have to migrate from CircleCI 1.0 to 2.0. After I have changed the old configuration to the new one, build failed because of eslint-plugin-prettier reported prettier spacing violations.
MyProject - is my GitHub repo and it contains a folder client which has all front-end code which I want to build on CI. In client f... | I have finally figured it out.
My package.json file contained the following dependency on the Prettier:
"prettier": "^1.11.1".
I had to learn hard way the meaning of this little symbol ^. It allows installing any version of Prettier which is compatible with 1.11.1. In my case on CircleCI 2.0 it installed 1.14.2 which ... | CircleCI | 51,121,469 | 12 |
I'm trying to migrate from Crashlytics Beta to Firebase App Distribution.
CircleCi in the Middle.
The build failes in CircleCi with the following error:
What went wrong:
Execution failed for task ':FiverrApp:appDistributionUploadRelease'.
Service credentials file does not exist. Please check the service credentia... | Try to use $rootDir to get a path. For example if you pass you credentials file api-project-xxx-yyy.json to root directory than you can take it something like this:
firebaseAppDistribution {
...
serviceCredentialsFile="$rootDir/api-project-xxx-yyy.json"
}
| CircleCI | 58,743,588 | 12 |
I am trying to cache a command line tool needed for my build process. The tool is made out of NodeJS. The build succeeds, but I need it to run faster.
The relevant parts of my circle.yml look like this :
dependencies:
post:
- npm -g list
- if [ $(npm -g list | grep -c starrynight) -lt 1 ]; then npm ins... | Ok, I figured this out. Thanks to Hirokuni Kim of CircleCI for pointing me in the right direction.
The relevant bits of the new circle.yml looks like this :
machine:
node:
version: 0.10.33
dependencies:
cache_directories:
- ~/nvm/v0.10.33/lib/node_modules/starrynight
- ~/nvm/v0.10.33/bin/starrynight
... | CircleCI | 31,766,930 | 11 |
This seems very basic but I can't find it anywhere in the docs. I'm working on a project where we run some tests through a shell script wrapper like:
./foo.sh a
./foo.sh b
./foo.sh c
foo.sh does not output XUnit format, so we need a different way to signal failure to CircleCI. Is exit 1 (or any nonzero exit code) rec... | Yes, CircleCI fails the build if any command, whether it runs tests or not, exits with a non-zero exit code. Documented in the configuration reference.
These snippets pulled from the above link go into detail on why that's the case:
For jobs that run on Linux, the default value of the shell option is
/bin/bash -eo pip... | CircleCI | 35,161,269 | 11 |
I am setting up a Circle CI build for an Android project, and am wondering how to add a gradle.properties file to my project build. I use a local gradle.properties to store my API keys and sensitive data. Other CI tools (ie, Jenkins) allow you to upload a gradle.properties file to use across all builds, but I am not ab... | Add all properties in the gradle.properties to CircleCI "Environment Variables", but prepend them with:
ORG_GRADLE_PROJECT_
| CircleCI | 35,440,907 | 11 |
I've been spending a day for the CircleCI in Android Project and I keep getting java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0 when CircleCI runs gradle dependencies command. Here is an stacktrace that it shows:
* Where:
Build file '/home/ubuntu/MyProje... | You get this error because a Java 7 VM tries to load a class compiled for Java 8
Java 8 has the class file version 52.0 but a Java 7 VM can only load class files up to version 51.0
In your case the Java 7 VM is your gradle build and the class is com.android.build.gradle.AppPlugin
Please give me some advices.
Try to u... | CircleCI | 38,209,522 | 11 |
When I run my docker-compose, it creates a web container and postgres container.
I want to manually trigger my Django tests to run, via something like
docker-compose run web python manage.py test
the problem with this is it creates a new container (requiring new migrations to be applied, housekeeping work, etc.)
The o... | While an accepted answer was provided, the answer itself is not really related to the title of this question:
Dynamically get a running container name created by docker-compose
To dynamically retrieve the name of a container run by docker-compose you can execute the following command:
$(docker inspect -f '{{.Name}}' ... | CircleCI | 41,623,477 | 11 |
I'm deploying to CircleCI and but my code is timing out.
The command in particular that CircleCI is calling that's causing the time-out is during the checkout stage:
git reset --hard SHA
Where SHA is the hash of the build, but upon ssh'ing in I noted that HEAD and others that I tried also run forever.
At that point t... | The issue was a typo, namely that CircleCI was running version 1.0, but should have been using 2.0.
In particular, I had created a .circleci/config.yaml, with the appropriate config.
... however, it should've been called .circleci/config.yml.
| CircleCI | 44,986,734 | 11 |
I have a very simple config.yml:
version: 2
jobs:
build:
working_directory: ~/app
docker:
- image: circleci/node:8.4.0
steps:
- checkout
- run: node -e "console.log('Hello from NodeJS ' + process.version + '\!')"
- run: yarn
- setup_remote_docker
- run: docker build .
... | I've created a workaround for myself.
In the very first step of the config.yml, I run this command:
if [[ $CIRCLE_SHELL_ENV == *"localbuild"* ]]; then
echo "This is a local build. Enabling sudo for docker"
echo sudo > ~/sudo
else
echo "This is not a local build. Disabling sudo for docker"
touch ~/sudo
fi
After... | CircleCI | 45,796,661 | 11 |
I am in the process of a setting up a CircleCI 2.0 configuration and I am needing to include the ubuntu package 'pdf2htmlex', but I am being given the following error:
apt-get update && apt-get install -y pdf2htmlex
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock dir... | You should be able to add sudo to theapt-get install line:
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
- image: circleci/postgres:9.6.2
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built ... | CircleCI | 46,781,452 | 11 |
I tried continuous integration tools Travis CI, CircleCI and codeship, but found none of them provide support document for phabricator. Does anyone have ideas about how to do continuous integration (CI) with Phabricator?
| I have done an integration with Travis-CI by adding post diff and land hooks to Phabricator to push diffs as branches to GitHub where Travis looks for branch updates. As far as I know, Travis-CI integrates only with GitHub, so if your main repo is there and Phabricator is pointing to it, it can be done.
If you want to ... | CircleCI | 27,517,657 | 10 |
I am now using the CircleCI for my project. Also I am implementing the new constraintLayout in my project. Now I am stuck with the CircleCI building. It shows me this when gradle -dependencies run:
File /home/ubuntu/.android/repositories.cfg could not be loaded.
FAILURE: Build failed with an exception.
* What went wro... | Alex Fu's answer explains nicely where the problem lies and how to deal with it but there is a simpler solution. Since the license files are really just simple files with a bunch of hex characters in them you can create them simply without any copying. An example would be putting the following code into the pre: sectio... | CircleCI | 38,210,675 | 10 |
I'm trying to deploy to Elastic Beanstalk, specifically using CircleCI, and I ran into this error:
ERROR: UndefinedModelAttributeError - "serviceId" not defined in the metadata of the model: <botocore.model.ServiceModel object at 0x7fdc908efc10>
From my Google search, I see that it's a Python error which makes sense be... | Update
EBCLI 3.14.6 is compatible with the current latest AWS CLI (> 1.16.10).
Previously ...
To solve this issue:
Upgrade awsebcli to 3.14.5: Upgrade awsebcli to 3.14.6
pip install awsebcli --upgrade
OR
If you must continue using awsebcli < 3.14.5, perform:
pip install 'botocore<1.12'
The core of the problem is... | CircleCI | 52,237,638 | 10 |
I've read this answer, reducing boilerplate, looked at few GitHub examples and even tried redux a little bit (todo apps).
As I understand, official redux doc motivations provide pros comparing to traditional MVC architectures. BUT it doesn't provide an answer to the question:
Why you should use Redux over Facebook Fl... | Redux author here!
Redux is not that different from Flux. Overall it has same architecture, but Redux is able to cut some complexity corners by using functional composition where Flux uses callback registration.
There is not a fundamental difference in Redux, but I find it makes certain abstractions easier, or at lea... | Flux | 32,461,229 | 1,124 |
I just recently discovered Redux. It all looks good. Are there any downsides, gotcha or compromises of using Redux over Flux? Thanks
| Redux author here!
I'd like to say you're going to make the following compromises using it:
You'll need to learn to avoid mutations. Flux is unopinionated about mutating data, but Redux doesn't like mutations and many packages complementary to Redux assume you never mutate the state. You can enforce this with dev-only... | Flux | 32,021,763 | 249 |
I'm going migrate to Redux.
My application consists of a lot of parts (pages, components) so I want to create many reducers. Redux examples show that I should use combineReducers() to generate one reducer.
Also as I understand Redux application should have one store and it is created once the application starts. When t... |
Update: see also how Twitter does it.
This is not a full answer but should help you get started. Note that I'm not throwing away old reducers—I'm just adding new ones to the combination list. I see no reason to throw away the old reducers—even in the largest app you're unlikely to have thousands of dynamic modules, w... | Flux | 32,968,016 | 210 |
The first principle of Redux documentation is:
The state of your whole application is stored in an object tree within a single store.
And I actually thought that I understand all of the principles well.
But I'm now confused, what does application mean.
If application means just one of little complicated part in a web... | If you would like to persist your redux state across a browser refresh, it's best to do this using redux middleware. Check out the redux-persist and redux-storage middleware. They both try to accomplish the same task of storing your redux state so that it may be saved and loaded at will.
--
Edit
It's been some time sin... | Flux | 37,195,590 | 144 |
I use axios for ajax requests and reactJS + flux for render UI. In my app there is third side timeline (reactJS component). Timeline can be managed by mouse's scroll. App sends ajax request for the actual data after any scroll event. Problem that processing of request at server can be more slow than next scroll event. ... | Axios does not support canceling requests at the moment. Please see this issue for details.
UPDATE: Cancellation support was added in axios v0.15.
EDIT: The axios cancel token API is based on the withdrawn cancelable promises proposal.
UPDATE 2022: Starting from v0.22.0 Axios supports AbortController to cancel requests... | Flux | 38,329,209 | 136 |
I am new on react.js I have implemented one component in which I am fetching the data from server and use it like,
CallEnterprise:function(TenantId){
fetchData('http://xxx.xxx.xx.xx:8090/Enterprises?TenantId='+TenantId+' &format=json').then(function(enterprises)
{
EnterprisePerspectiveActions.getEnt... | With webpack you can put env-specific config into the externals field in webpack.config.js
externals: {
'Config': JSON.stringify(process.env.NODE_ENV === 'production' ? {
serverUrl: "https://myserver.com"
} : {
serverUrl: "http://localhost:8090"
})
}
If you want to store the configs in a separate JSON fi... | Flux | 30,568,796 | 132 |
Should you ever use this.setState() when using redux? Or should you always be dispatching actions and relying on props?
| Clear uses of setState would be for UI components that have local display state, but aren't relevant for the global application. For example a boolean that represents whether a specific dropdown menu is actively displayed doesn't need to be in global state, so it's more conveniently controlled by the menu component's s... | Flux | 34,711,477 | 118 |
Here is the code in actions.js
export function exportRecordToExcel(record) {
return ({fetch}) => ({
type: EXPORT_RECORD_TO_EXCEL,
payload: {
promise: fetch('/records/export', {
credentials: 'same-origin',
method: 'post',
headers: {'Content-... | Browser technology currently doesn't support downloading a file directly from an Ajax request. The work around is to add a hidden form and submit it behind the scenes to get the browser to trigger the Save dialog.
I'm running a standard Flux implementation so I'm not sure what the exact Redux (Reducer) code should be, ... | Flux | 35,206,589 | 76 |
According to docs state of react app has to be something serializable.
What about classes then?
Let's say I have a ToDo app.
Each of Todo items has properties like name, date etc. so far so good.
Now I want to have methods on objects which are non serializable. I.e. Todo.rename() which would rename todo and do a lot of... | In Redux, you don't really have custom models. Your state should be plain objects (or Immutable records). They are not expected to have any custom methods.
Instead of putting methods onto the models (e.g. TodoItem.rename) you are expected to write reducers that handle actions. That's the whole point of Redux.
// Manage... | Flux | 32,352,982 | 53 |
Looking at the following diagram (which explains MVC), I see unidirectional data flow.
So why do we consider MVC to have bidirectional data flow while justifying Flux ?
| Real and Pure MVC is unidirectional. It is clear from the the wikipedia diagram pasted in the question.
More than a decade ago, when server side frameworks like Apache Struts implemented a variant of MVC called Model View Presenter (MVP) pattern, they made every request go through controller and every response come bac... | Flux | 33,447,710 | 51 |
I've been struggling for hours to finding a solution to this problem...
I am developing a game with an online scoreboard. The player can log in and log out at any time. After finishing a game, the player will see the scoreboard, and see their own rank, and the score will be submitted automatically.
The scoreboard shows... | When you want complex async dependencies, just use Bacon, Rx, channels, sagas, or another asynchronous abstraction. You can use them with or without Redux. Example with Redux:
observeSomething()
.flatMap(someTransformation)
.filter(someFilter)
.map(createActionSomehow)
.subscribe(store.dispatch);
You can com... | Flux | 32,925,837 | 47 |
What is the general practice of setting the initial state of the app with isomorphic applications? Without Flux I would simple use something like:
var props = { }; // initial state
var html = React.renderToString(MyComponent(props);
Then render that markup via express-handlebars and display via {{{reactMarkup}}.
On th... | Take a look at dispatchr and yahoo's related libraries.
Most flux implementations don't work in node.js because they use singleton stored, dispatchers, and actions, and have no concept of "we're done" which is required to know when to render to html and respond to the request.
Yahoo's libraries like fetchr and routr ... | Flux | 27,336,882 | 43 |
Recently I conducted a preliminary study on developing an E-commerce site and discovered that redux and reflux both come from flux architecture in Facebook and that both are popular. I am confused about the difference between the two.
When should I use redux vs reflux, and which is most flexible during the development ... | Flux, Reflux and Redux (and many other similar libraries) are all different ways to handle transversal data management.
Basic React components work fine with parent-children relationships, but when you have to provide and update data from different parts of the app which are not directly connected it can become quickly... | Flux | 36,326,210 | 39 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.